Jump to navigation Jump to search
112 bytes added ,  13: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
* Initial values for global options can also be specified via system properties, which can e.g. be passed on with the [ -D flag] on command line, or using [,%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
* 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">
* In a [[Web Application]], the default can be adjusted in the {{Code|web.xml}} file as follows:
<pre classsyntaxhighlight lang="brush:xml">
* 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">
<text xml:space="preserve">To <b>be</b>, or not to <b>be</b>, that is the question.</text>
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">
XQUERY declare variable $GREETING external; $GREETING
Bureaucrats, editor, reviewer, Administrators


Navigation menu