Edit online

XPath and XML Catalogs

The evaluation of the XPath expression tries to resolve the locations of documents referenced in the expression through XML Catalogs.

Example:

As an example, consider the evaluation of the collection(URIofCollection) function (XPath 2.0). To resolve the references from the files returned by the collection() function with an XML catalog, specify the class name of the catalog-enabled parser for parsing these collection files. The class name is ro.sync.xml.parser.CatalogEnabledXMLReader. Specify it as it follows:
let $docs := collection(iri-to-uri(
   "file:///D:/temp/test/XQuery-catalog/mydocsdir?recurse=yes;select=*.xml;
   parser=ro.sync.xml.parser.CatalogEnabledXMLReader"))