<!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.18226" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=167483911-21052009><FONT face=Arial
color=#0000ff size=2>There's no such thing as a subcollection in standard
XQuery.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=167483911-21052009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=167483911-21052009><FONT face=Arial
color=#0000ff size=2>Your namespace prefix xmldb hints that you are using vendor
extensions, so I suggest you ask on a list that's specific to your chosen XQuery
implementation.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=167483911-21052009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=167483911-21052009><FONT face=Arial
color=#0000ff size=2><!-- Converted from text/plain format -->
<P><FONT size=2>Regards,<BR><BR>Michael Kay<BR><A
href="http://www.saxonica.com/">http://www.saxonica.com/</A><BR><A
href="http://twitter.com/michaelhkay">http://twitter.com/michaelhkay</A>
</FONT></P></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> 21 May 2009 12:23<BR><B>To:</B>
talk@x-query.com<BR><B>Subject:</B> [xquery-talk] List
subcollections<BR></FONT><BR></DIV>
<DIV></DIV>Hi to all,
<DIV><BR></DIV>
<DIV>I want to list all the content (documents and subcollections) of a
specific collection:<BR></DIV>
<DIV>I'm using the following query:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV>let $host := '<A
href="http://localhost:8080">http://localhost:8080</A>'</DIV>
<DIV>let $col := xmldb:xcollection('/db')</DIV>
<DIV>for $p in $col</DIV>
<DIV>let $title := document-uri($p)</DIV>
<DIV>let $id :=
substring(document-uri($p),5,string-length(document-uri($p))-8)</DIV></DIV>
<DIV>
<DIV>return <p><a
href='{$host}/{$id}'>{$title}</a></p><BR></DIV></DIV>
<DIV><BR clear=all><BR></DIV>
<DIV>This way i only list the documents of a specific collection.</DIV>
<DIV>How can i list the subcollections?</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV>Thanks in advance!</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV><BR>-- <BR>Ricardo Queirós<BR></DIV></BLOCKQUOTE></BODY></HTML>