Changes

Jump to navigation Jump to search
1,195 bytes added ,  16:12, 20 May 2013
* {{Code|declare option output:method 'raw';<br/>db:retrieve("DB", "music/01.mp3")}} returns the specified audio file as raw data.
* <code><nowiki>stream:materialize(db:retrieve("DB", "music/01.mp3"))</nowiki></code> returns a materialized representation of the streamable result.
|}
 
==db:export==
 
{{Mark|Added with Version 7.7}}:
 
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:export|$db as xs:string, $path as xs:string|empty-sequence()}}<br />{{Func|db:export|$db as xs:string, $path as xs:string, $params as item()|empty-sequence()}}<br />
|-
| '''Summary'''
|Exports the specified database {{Code|$db}} to the specified file {{Code|$path}}. Existing files will be overwritten. The {{Code|$params}} argument contains serialization parameters (see [[Serialization]] for more details), which can either be specified<br />
* as children of an {{Code|&lt;output:serialization-parameters/&gt;}} element, as defined for the [http://www.w3.org/TR/xpath-functions-30/#func-serialize fn:serialize()] function; e.g.:
<pre class="brush:xml">
<output:serialization-parameters>
<output:method value='xml'/>
<output:cdata-section-elements value="div"/>
...
</serialization-parameters>
</pre>
* as map, which contains all key/value pairs:
<pre class="brush:xml">
map { "method" := "xml", "cdata-section-elements" := "div", ... }
</pre>
|-
| '''Errors'''
|{{Error|BXDB0002|XQuery Errors#BaseX Errors}} The addressed database does not exist or could not be opened.
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu