Hi Helen,

Add an element like <referencedauthor>James Wang</referencedauthor> in the 
document, perhaps in a new metadata block up top.  Put a range index on the 
chosen QName of type xs:string.  Then use cts:element-values() to extract the 
referenced authors.  You can pass a cts:query call to the function if you want 
to limit to just articles matching a query.  This approach will be fast at 
scale.  With the content shaped like you have right now, there's not an 
optimized way to do this at scale.

-jh-

On May 3, 2011, at 12:13 PM, Helen Chen wrote:

> Hello there,
> 
> We have article xml in marklogic, inside each article, it lists the 
> references that this article cited. I want to do a search to find out that 
> inside /article/back/reference/citation/ref/jcite, which author is referenced 
> most, or I can get a list of top 5  refauth who shows up in the reference 
> section  most in article.  
> 
> The article structure like the following:
> <article>
>     <front>…</front>
>     <back>
>         <references>
>             <citation id="c1">
>                 <ref>
>                     <jcite>
>                         <refauth>
>                             <fname>James</fname>
>                             <surname>Wang</surname>
>                         </refauth>
>                         <jtitle>article title</jtitle>
>                         <coden>AAA</coden>
>                         <issn>1111</issn>
>                         <volume>1</volume>
>                         <pages>90</pages>
>                         <date>2007</date>
>                     </jcite>
>                 </ref>
>             </citation>
>         </references>
>         <references>
>             <citation id="c2">
>                 <ref>
>                     <jcite>
>                         <refauth>
>                             <fname>Tom</fname>
>                             <surname>Ding</surname>
>                         </refauth>
>                         <jtitle>my article title</jtitle>
>                         <coden>AAB</coden>
>                         <issn>1112</issn>
>                         <volume>1</volume>
>                         <pages>20</pages>
>                         <date>2008</date>
>                     </jcite>
>                 </ref>
>             </citation >
>         </references>
>     </back>
> </article>
> 
> 
> Can anyone give me a suggestion how to do it? Or how to start ?
> 
> Thanks, helen
> _______________________________________________
> 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