Changes

Jump to navigation Jump to search
No change in size ,  23:52, 25 April 2012
no edit summary
Database must follow the [[Valid Names|valid names constraints]].
=Manage Access Resources= Stored resources and external documents can be accessed in different ways: ==XML Documents== {{Mark|Updated with Version 7.2.1:}} Various XQuery functions exist to access XML documents in databases and from other locations: * {{Mono|db:open("dbname", "PATH/TO/DOCS")}}: returns documents that are found in the specified database at the specified (optional) path.* {{Mono|collection("PATH/TO/DOCS")}}: returns all documents that are found at the location {{Mono|TO/DOCS}} in the database {{Mono|PATH}}. 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("PATH/TO/DOC.XML")}}: returns the document found at the location {{Mono|TO/DOC.XML}} in the database {{Mono|PATH}}. 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. ==Raw Files== * XQuery: <code>db:retrieve("dbname", "path/to/docs")</code> returns raw files in their Base64 representation. By choosing <code>"method=raw"</code> as [[Serialization|Serialization Option]], the data is returned in its original byte representation: <pre class="brush:xquery">declare option output:method "raw";db:retrieve('multimedia', 'sample.avi')</pre> * Commands: <code>[[Commands#RETRIEVE|RETRIEVE]]</code> returns raw files without modifications. ==HTTP Services== * With [[REST]] and [[WebDAV]], all database resources can be requested in a uniform way, no matter if they are well-formed XML documents or binary files. =Update Resources=
Once you have created a database, additional commands exist to modify its contents:
Last but not least, XML documents can also be added via the GUI and the ''Database'' menu.
 
=Access Resources=
 
Stored resources and external documents can be accessed in different ways:
 
==XML Documents==
 
{{Mark|Updated with Version 7.2.1:}}
 
Various XQuery functions exist to access XML documents in databases and from other locations:
 
* {{Mono|db:open("dbname", "PATH/TO/DOCS")}}: returns documents that are found in the specified database at the specified (optional) path.
* {{Mono|collection("PATH/TO/DOCS")}}: returns all documents that are found at the location {{Mono|TO/DOCS}} in the database {{Mono|PATH}}. 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("PATH/TO/DOC.XML")}}: returns the document found at the location {{Mono|TO/DOC.XML}} in the database {{Mono|PATH}}. 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.
 
==Raw Files==
 
* XQuery: <code>db:retrieve("dbname", "path/to/docs")</code> returns raw files in their Base64 representation. By choosing <code>"method=raw"</code> as [[Serialization|Serialization Option]], the data is returned in its original byte representation:
 
<pre class="brush:xquery">
declare option output:method "raw";
db:retrieve('multimedia', 'sample.avi')
</pre>
 
* Commands: <code>[[Commands#RETRIEVE|RETRIEVE]]</code> returns raw files without modifications.
 
==HTTP Services==
 
* With [[REST]] and [[WebDAV]], all database resources can be requested in a uniform way, no matter if they are well-formed XML documents or binary files.
=Export Data=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu