Changes

Jump to navigation Jump to search
144 bytes added ,  12:53, 8 July 2020
no edit summary
Lines starting with <code>#</code> are interpreted as comments and are skipped. With the following script, a database is created, two documents are added to it, and a query is performed:
<pre classsyntaxhighlight lang="brush:xml">
CREATE DB test
ADD TO embedded.xml <root>embedded</root>
XQUERY <hits>{ count(//text()) }</hits>
CLOSE
</presyntaxhighlight>
===XML Syntax===
The XML syntax provides more flexibility here. Multiple commands can be enclosed by a {{Code|<commands/>}} root element. Some commands, such as {{Command|ADD}}, allow you to directly embed XML documents. If you want to embed XML in XQuery expressions, entities should be encoded, or the {{Code|CDATA}} syntax should be used:
<pre classsyntaxhighlight lang="brush:xml">
<commands>
<create-db name='test'/>
<close/>
</commands>
</presyntaxhighlight>
==Glob Syntax==
* {{Code|name}} must be a [[#Valid Names|valid database name]]
* database creation can be controlled by setting [[Options#Create Options|Create Options]]
If you need to add initial resources, it is always faster to supply them at creation time than adding them in a subsequent step via {{Command|ADD}}.
|-
| '''Errors'''
==ALTER BACKUP==
 
{{Mark|Introduced with Version 9.3:}}
{| width='100%'
Bureaucrats, editor, reviewer, Administrators
13,551

edits

Navigation menu