Hi Tim,

actually <coden> is just a tag in the article xml, but it is unique,  volume 
and issue are also unique in the article.  We have  a lot of articles for each 
issue, 20-30 issues for each volume, may be over 100 volumes for each coden,

The result I want to get should not be big because I only want one element for 
each coden.

I see the loop, I feel it is too many loops to run.

Thanks, Helen

On Nov 17, 2010, at 11:26 AM, Tim Meagher wrote:

> Hi Helen,
>  
> I guess the first thing I'd want to know is how big the resulting document is 
> going to be and hw you want to store it, i.e. do you want to fragment a large 
> document by coden or perhaps have a separate document for each unique coden.
>  
> Secondly I would probably approach this as a transform, doing something like 
> this:
>  
> let $distinct-codens := distinct-values(~/article/coden/text())
> return
>   for $coden in $distinct-codens
>     return element coden {
>       for $article in ~/article
>         where $article/coden/text() eq $coden
>         return (
>           $article/volume,
>           $article/issue,
>           …
>         )
> }
>  
> Hope this helps!  I hope to see some more robust ideas come out.
>  
> Tim Meagher
>  
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to