* The {{Code|.basex}} [[Configuration#Configuration Files|configuration file]] is parsed by every new local BaseX instance. It contains all global options. Local options can be specified at the end of the file after the {{Code|Local Options}} comment:
<syntaxhighlight pre lang="perl">
# General Options
DEBUG = false
# Local Options
CATALOG = etc/w3-catalog.xml
</syntaxhighlightpre>
* Initial values for global options can also be specified via system properties, which can be passed on with the [https://docs.oracle.com/en/java/javase/11/tools/java.html -D flag] on the command line, or with [https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/System.html#setProperty(java.lang.String,java.lang.String) System.setProperty()] before creating a BaseX instance. The specified keys need to be prefixed with {{Code|org.basex.}}. An example:
<syntaxhighlight pre lang="perl">
java -Dorg.basex.CATALOG=etc/w3-catalog.xml -cp basex.jar org.basex.BaseX -c"SHOW OPTIONS catalog"
CATALOG: etc/w3-catalog.xml
</syntaxhighlightpre>
* If the Mac OS X packaged application is used, global options can be set within the Info.plist file within the Contents folder of the application package. For example:
<syntaxhighlight pre lang="xml">
<key>JVMOptions</key>
<array>
<string>-Dorg.basex.CATALOG=etc/w3-catalog.xml</string>
</array>
</syntaxhighlightpre>
* In a [[Web Application]], the default can be adjusted in the {{Code|web.xml}} file as follows:
<syntaxhighlight pre lang="xml">
<context-param>
<param-name>org.basex.catalog</param-name>
<param-value>etc/w3-catalog.xml</param-value>
</context-param>
</syntaxhighlightpre>
* In XQuery, local options can be set via option declarations and [[XQuery Extensions#Pragmas|pragmas]].
* If the option is enabled, whitespaces of an element and its descendants can locally be preserved with the <code>xml:space="preserve"</code> attribute:
<syntaxhighlight pre lang="xml">
<xml>
<title>
<text xml:space="preserve">To <b>be</b>, or not to <b>be</b>, that is the question.</text>
</xml>
</syntaxhighlightpre>
If whitespaces are stripped, <code>indent=yes</code> can be assigned to the {{Option|SERIALIZER}} option to get properly indented XML output.<br/>
See [[BaseX_10#Whitespaces|BaseX 10: Whitespaces]] for more information on whitespace handling.
* <code>{URI}a=x</code> binds the value {{Code|x}} to the variable $a with the namespace {{Code|URI}}.
* In the following [[Commands#Command_Scripts| Command Script]], the value {{Code|hello world!}} is bound to the variable {{Code|$GREETING}}:
<syntaxhighlight pre lang="'xquery"'>
SET BINDINGS GREETING="hello world!"
XQUERY declare variable $GREETING external; $GREETING
</syntaxhighlightpre>
|}
| '''Summary'''
|When creating new nodes in XQuery via [https://www.w3.org/TR/xquery-31/#id-constructors Node Constructors], copies of all enclosed nodes are created, and the copied nodes get new node identities. As a result, the following query yields <code>false</code>:
<syntaxhighlight pre lang="'xquery"'>
let $a := <a/>
let $b := <b>{ $a }</b>
return $b/a is $a
</syntaxhighlightpre>
This step can be expensive and memory consuming. If the option is disabled, child nodes will only be linked to the new parent nodes, and the upper query returns <code>true</code>.<br/>The option should be used carefully as it changes the semantics of XQuery. It should preferably be used in [[XQuery Extensions#Database Pragmas|Pragmas]].
|}