Changes

Jump to navigation Jump to search
753 bytes added ,  12:09, 2 July 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 [httphttps://docs.oracle.com/javaseen/1.4.2java/docsjavase/tooldocs11/windowstools/java.html#options -D flag] on command line, or using [httphttps://docs.oracle.com/en/java/javase/611/docs/api/java.base/java/lang/System.html#setProperty(java.lang.String,%20javajava.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]].
| '''Summary'''
|Specifies the maximum length of a single [[Logging|log message]].
|}
 
===LOGTRACE===
 
{{Mark|Introduced with Version 9.4:}}
 
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|LOGTRACE [boolean]}}
|-
| '''Default'''
|{{Code|true}}
|-
| '''Summary'''
|If BaseX is running as [[Web Application]], trace output (generated via {{Code|fn:trace}}, {{Function|Profiling|prof:dump}} and similar functions) if written to the [[Logging|database logs]]. If this option is disabled, trace output will be redirected to standard error, as it is known from the standalone version of BaseX.
|}
|-
| '''Summary'''
|Enables the Jetty provides a [https://www.eclipse.org/jetty/documentation/current/gzip-filter.html GZIP Gzip handler] in Jetty, which will for dynamically uncompress uncompressing requests and compress compressing responses. This feature can be enabled if Jetty is started via the [[Web Application|BaseX HTTP Server]]:* The option can also be enabled on [[Command-Line Options#HTTP Server|command line]] via <code>-g</code>.* It cannot be assigned via the {{Code|web.xml}} file, as it will be evaluated before the configuration files are parsed.* The [https://github.com/eclipse/jetty.project/blob/7cc552013eb4d05cb603ba0bc85d176c97957cd4/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java#L187-L211 sane same defaults] of Jetty the web server will be applied (support for GET requests, exclusion of binaries, MSIE 6.0, etc.).* The option cannot be assigned via the {{Code|web.xml}} file, as it will be evaluated before the configuration files are parsed.* The option can also be changed on [[Command-Line Options#HTTP Server|command line]] via <code>-g</code>.
|}
===RESTXQERRORS===
 
{{Mark|Introduced with Version 9.2.}}
{| width='100%'
|-
| '''Summary'''
|Many XML documents include whitespaces that have been added to improve readability. This option controls the [httphttps://www.w3.org/TR/REC-xml/#sec-white-space white-space processing mode] of the XML parser:
* With the default value {{Code|true}}, leading and trailing whitespaces from text nodes will be chopped and all empty text nodes will be discarded.
* The flag should be turned off if a document contains [[Full-Text#Mixed Content|mixed content]].
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.
|}
|-
| '''Summary'''
|A new If a text file with stop words is specified, frequently used terms contained in that file will be ignored when a full-text index will drop tokens that are listed in the specified stopword listis created. A stopword list may decrease the size of the full text indexand speed up your queries. See [[Indexes#Full-Text Index|Full-Text Index]] for more details.
|}
* Commas in values must be duplicated.
* Variables may optionally be introduced with a leading dollar sign.
* If a variable uses a namespace different to the default namespace, it can be specified with the [http://www.jclark.com/xml/xmlns.htm Clark Notation] or [httphttps://www.w3.org/TR/xquery-30/#id-basics Expanded QName Notation].
This option can also be used on [[Command-Line Options#BaseX Standalone|command line]] with the flag <code>-b</code>.
|-
* <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>
|}
|-
| '''Summary'''
|Specifies how many stack frames of [httphttps://en.wikipedia.org/wiki/Tail_call tail-calls] are allowed on the stack at any time. When this limit is reached, tail-call optimization takes place and some call frames are eliminated. The feature can be turned off by setting the value to {{Code|-1}}.
|}
|-
| '''Summary'''
|By default, URIs resources specified in the via [[Databases#XML Documents|fn:doc]] and [[Databases#XML Documents|fn:collection]] functions will also be resolved against existing databasesare looked up both in the database and in the file system. If you always use {{Function|Database|db:open}} is consistently used to access database documentsdatabases, it is recommendable to disable this option:* No locks will be created for the two functions (see [[Transaction Management#Limitations|limitations of database locking]] for more details).
* Access to local and external resources will be faster, as the database lookup will be skipped.
* No locks will be created by the two functions (see [[Transaction Management#Limitations|limitations of database locking]] for more details).
|}
===FULLPLAN===
 
{{Mark|Introduced with Version 9.2:}}
{| width='100%'
=Changelog=
 
;Version 9.3
* Added: {{Option|LOGTRACE}}
;Version 9.3
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu