<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6001.18183" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2>The meaning of a collection URI varies from one 
implementation to another, but you are only allowed one collection URI as the 
argument.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2>I think you want</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2>for $uri in ("A", "B")</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2>for $doc in collection($uri)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2>where ....</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2>return document-uri($doc)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2>Michael Kay</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=655184711-06022009><FONT face=Arial 
color=#0000ff size=2>http://www.saxonica.com/</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> talk-bounces@x-query.com 
  [mailto:talk-bounces@x-query.com] <B>On Behalf Of </B>ricardo 
  queiros<BR><B>Sent:</B> 06 February 2009 11:33<BR><B>To:</B> 
  talk@x-query.com<BR><B>Subject:</B> [xquery-talk] Get collection context in 
  XQuery<BR></FONT><BR></DIV>
  <DIV></DIV>Hi,
  <DIV><BR></DIV>
  <DIV>I'm a newbie in XQuery and i appreciate a answer to this doubt.</DIV>
  <DIV><BR></DIV>
  <DIV>I store several XML documents in a Native XML Database (eXist).</DIV>
  <DIV>In my organisation i have several collections with several XML files that 
  share the same structure. The following structure defines 2 collections A and 
  B. The collection A have 2 XML files and the collection B one.&nbsp;</DIV>
  <DIV><BR></DIV>
  <DIV>A</DIV>
  <DIV>&nbsp;&nbsp;- 1.xml</DIV>
  <DIV>&nbsp;&nbsp;- 2.xml</DIV>
  <DIV>B</DIV>
  <DIV>&nbsp;&nbsp;- 3.xml&nbsp;</DIV>
  <DIV><BR></DIV>
  <DIV>I have his XQuery file:</DIV>
  <DIV><BR></DIV>
  <DIV>FOR $x in collection("A","B")<BR></DIV>
  <DIV>WHERE ...</DIV>
  <DIV>RETURN ?</DIV>
  <DIV><BR></DIV>
  <DIV>If, for example, only the 2.xml and 3.xml were evaluate for TRUE in the 
  WHERE clause, i want to obtain the following XML data:</DIV>
  <DIV><BR></DIV>
  <DIV>&lt;RESULTS&gt;</DIV>
  <DIV>&lt;A&gt;2.xml&lt;A&gt;</DIV>
  <DIV>&lt;B&gt;3.xml&lt;/B&gt;</DIV>
  <DIV>&lt;/RESULTS&gt;</DIV>
  <DIV><BR></DIV>
  <DIV>What should i put in the RETURN clause?</DIV>
  <DIV><BR></DIV>
  <DIV>I can also have collections inside other collections...</DIV>
  <DIV><BR></DIV>
  <DIV>Thanks in advance</DIV>
  <DIV><BR></DIV>
  <DIV><BR></DIV>
  <DIV><BR clear=all><BR>-- <BR>Ricardo 
Queirós<BR></DIV></BLOCKQUOTE></BODY></HTML>