Sign In/My Account | View Cart  
advertisement

Article:
 What Is XQuery
Subject: idref
Date: 2003-11-12 11:32:24
From: Per Bothner
Response to: idref

This should get you on the right track. Note that for more complex conditions you might want to use a 'where' clause rather than a [predicate].


let $id := "sai@yahoo.com",
for $paper in $doc/PAPER[@EMAILID = $id],
for $author in $doc/AUTHOR[@EMAILID = $id]
return
<result PAPERID="{$paper/@PAPERID}">
{$author/FNAME}
<result>


This assumes you have a specific emailid. If you want this for all emailids, you could do:


for $paper in $doc/PAPER,
for $author in $doc/AUTHOR
where $paper/@EMAILID = $auther/$EMAILID
return
<result PAPERID="{$paper/@PAPERID}">
{$author/FNAME}
<result>


XQuery does not have the => operator.


No Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Sponsored By: