N. America: 800 876 3101 | World: 44 (0) 1753 218 930

In what order does fn:collection() return documents?

In DataDirect XQuery™, the order of documents returned by the fn:collection() depends on which function options you specify to fetch documents from folders. If you don't select any "sort" options (collection("file:///c:/books?select=*.xml"), for example), the order in which documents are returned is not guaranteed; if you use any "sort" option, is specified (collection("file:///c:/books?select=*.xml";sort=a), for example), then documents are returned in the requested order.


Next Question!

What is a context item type? And how do I set it?

Submit Your DataDirect XQuery Tip or Trick

Tell us your XQuery Tip or Trick – if it gets published on our site, you’ll receive a

$10.00 Amazon.com
Gift Certificate!

Submit your tip or trick today.