Changes

Jump to navigation Jump to search
101 bytes added ,  22:58, 25 April 2012
Various XQuery functions exist to access XML documents in databases and from other locations:
* {{Mono|db:open("dbnamedb", "PATHpath/TOto/DOCStocs")}}: returns documents that are found in the specified database at the specified (optional) path.* {{Mono|collection("PATHdb/TOpath/DOCSto/docs")}}: returns all documents that are found at the location {{Mono|TOpath/to/DOCSdocs}} in the database {{Mono|PATHdb}}. If the addressed database does not exist, or if the argument does not start with a valid database name, the string is interpreted as URI reference, and the documents found at this location will be returned.* {{Mono|doc("PATHdb/TOpath/DOCto/doc.XMLxml")}}: returns the document found at the location {{Mono|TOpath/DOCto/doc.XMLxml}} in the database {{Mono|PATHdb}}. If the addressed database does not exist, or if the argument does not start with a valid database name, the string is interpreted as URI reference, and the document found at this location will be returned.
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.
 
If the argument of {{Mono|fn:doc()}} or {{Mono|fn:collection()}} does not start with a valid database name, or if the addressed database does not exist, the string is interpreted as URI reference, and the documents found at this location will be returned. Examples:
 
* {{Mono|doc("http://web.de")}}: retrieves the addressed URI and returns it as a main-memory document node.
* {{Mono|collection("/path/to/docs")}}: returns a main-memory collection with all XML documents found in the addressed directory.
==Raw Files==
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu