Changes

Jump to navigation Jump to search
537 bytes added ,  20:07, 13 October 2011
no edit summary
==Access Resources==
 
The stored resources can be accessed in different ways:
 
===XML Documents===
Various XQuery functions exist to access the XML documents in databases and other locations:
* <code>collection("path/to/docs")</code>: returns the documents that are either found in the database specified in the argument, or the specified location.
* <code>doc("path/to/document.xml")</code>: returns a single document found at the specified location. If a database exists for the specified file, it is opened instead.
 
===Raw Files===
 
* The <code>[[Commands#RETRIEVE|RETRIEVE]]</code> command returns raw files without modifications.
* The XQuery function <code>db:retrieve("dbname", "path/to/docs")</code> returns raw files in their Base64 representation. By choosing <code>"method=raw"</code> as [[Serialization]] parameter, the data is returned in its raw form:
 
<pre class="brush:xquery">
declare option output:method "raw";
db:retrieve('multimedia', 'sample.avi')
</pre>
[[Category:Beginner]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu