Changes

Jump to navigation Jump to search
112 bytes added ,  12:53, 27 February 2020
no edit summary
* 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:
<pre classsyntaxhighlight lang="brush:perl">
# General Options
DEBUG = false
# Local Options
CHOP = false
</presyntaxhighlight>
* Initial values for global options can also be specified via system properties, which can e.g. be passed on with the [http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html#options -D flag] on command line, or using [http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#setProperty(java.lang.String,%20java.lang.String) System.setProperty()] before creating a BaseX instance. The specified keys need to be prefixed with {{Code|org.basex.}}. An example:
<pre classsyntaxhighlight lang="brush:xqueryperl">
java -Dorg.basex.CHOP=false -cp basex.jar org.basex.BaseX -c"get chop"
CHOP: false
</presyntaxhighlight>
* If using the Mac OS X packaged application then global options can be set within the Info.plist file within the Contents folder of the application package. For example:
<pre classsyntaxhighlight lang="brush:xml">
<key>JVMOptions</key>
<array>
<string>-Dorg.basex.CHOP=false</string>
</array>
</presyntaxhighlight>
* In a [[Web Application]], the default can be adjusted in the {{Code|web.xml}} file as follows:
<pre classsyntaxhighlight lang="brush:xml">
<context-param>
<param-name>org.basex.chop</param-name>
<param-value>false</param-value>
</context-param>
</presyntaxhighlight>
* In XQuery, local options can be set via option declarations and [[XQuery Extensions#Pragmas|pragmas]].
In the following example document, the whitespaces in the text nodes of the {{Code|text}} element will not be chopped:
<pre classsyntaxhighlight lang="brush:xml">
<xml>
<title>
<text xml:space="preserve">To <b>be</b>, or not to <b>be</b>, that is the question.</text>
</xml>
</presyntaxhighlight>
It is recommendable to additionally assign <code>indent=no</code> to the {{Option|SERIALIZER}} option; otherwise the serialized documents will automatically be indented.
|}
* <code>a=1,,2</code> &nbsp; binds the value {{Code|1,2}} to the variable $a
* <code>{URI}a=x</code> &nbsp; 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}}:<pre classsyntaxhighlight lang="brush:xmlxquery">
SET BINDINGS GREETING="hello world!"
XQUERY declare variable $GREETING external; $GREETING
</presyntaxhighlight>
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu