Changes

Jump to navigation Jump to search
No change in size ,  15:13, 26 May 2012
m
Text replace - "{{Mono|" to "{{Code|"
|-
|<code>[[Database Module#db:open|db:open()]]</code>
|{{MonoCode|db:open("db", "path/to/tocs")}}|Returns all documents that are found in the database {{MonoCode|db}} at the (optional) path {{MonoCode|path/to/docs}}.
|-
|<code>[http://www.xqueryfunctions.com/xq/fn_collection.html fn:collection()]</code>
|{{MonoCode|collection("db/path/to/docs")}}|Returns all documents at the location {{MonoCode|path/to/docs}} in the database {{MonoCode|db}}.<br/>If no path is specified after the database, all documents in the database will be returned.<br/>If no argument is specified, all documents of the currently opened database will be returned.
|-
|<code>[http://www.xqueryfunctions.com/xq/fn_doc.html fn:doc()]</code>
|{{MonoCode|doc("db/path/to/doc.xml")}}|Returns the document at the location {{MonoCode|path/to/docs}} in the database {{MonoCode|db}}.<br/>An error is raised if the specified addresses does not address exactly one document.
|}
The {{MonoCode|fn:document-uri()}} and {{MonoCode|fn:base-uri()}} functions return URIs that can be reused as arguments for the {{MonoCode|fn:doc()}} and {{MonoCode|fn:collection()}} functions. As a result of this, as an example, the following query will always return {{MonoCode|true}}:
<pre class="brush:xquery">
</pre>
If the argument of {{MonoCode|fn:doc()}} or {{MonoCode|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:
* {{MonoCode|doc("http://web.de")}}: retrieves the addressed URI and returns it as a main-memory document node.* {{MonoCode|collection("/path/to/docs")}}: returns a main-memory collection with all XML documents found at the addressed file path.
==Raw Files==
===Version 7.2.1===
* Updated: {{MonoCode|fn:document-uri()}} and {{MonoCode|fn:base-uri()}} now return strings that can be reused with {{MonoCode|fn:doc()}} or {{MonoCode|fn:collection()}} to reopen the original document.
[[Category:Beginner]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu