Changes

Jump to navigation Jump to search
516 bytes added ,  00:16, 26 April 2012
Various XQuery functions exist to access XML documents in databases and from other locations:
* {| class="wikitable"|-!Function!Description!Example|-| valign='top' width='130'|<code>[[Database Module#db:open|db:open()]]</code>| valign='top' width='220'|{{Mono|db:open("db", "path/to/tocs")}}: returns |Returns all documents that are found in the specified database at the specified (optional) path.* |-| valign='top'|<code>[http://www.xqueryfunctions.com/xq/fn_collection.html fn:collection()]</code>| valign='top' |{{Mono|collection("db/path/to/docs")}}: returns |Returns all documents that are found at the location {{Mono|path/to/docs}} in the database {{Mono|db}}.All documents in the database are returned if no path is specified.|-| valign='top'|<code>[http://www.xqueryfunctions.com/xq/fn_doc.html fn:doc()]</code>* | valign='top' |{{Mono|doc("db/path/to/doc.xml")}}: returns |Returns the document found at the location {{Mono|path/to/doc.xmldocs}} in the database {{Mono|db}}.An error is raised if the specified addresses does not address exactly one document.|}
The {{Mono|fn:document-uri()}} and {{Mono|fn:base-uri()}} functions returns paths that can be reused as arguments for the {{Mono|fn:doc()}} and {{Mono|fn:collection()}} functions.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu