Changes

Jump to navigation Jump to search
45 bytes removed ,  14:04, 20 July 2022
# Local Options
CHOP CATALOG = falseetc/w3-catalog.xml
</syntaxhighlight>
<syntaxhighlight lang="perl">
java -Dorg.basex.CHOPCATALOG=false etc/w3-catalog.xml -cp basex.jar org.basex.BaseX -c"get chopSHOW OPTIONS catalog"CHOPCATALOG: falseetc/w3-catalog.xml
</syntaxhighlight>
* If using the Mac OS X packaged application then is used, global options can be set within the Info.plist file within the Contents folder of the application package. For example:
<syntaxhighlight lang="xml">
<key>JVMOptions</key>
<array>
<string>-Dorg.basex.CHOPCATALOG=falseetc/w3-catalog.xml</string>
</array>
</syntaxhighlight>
<syntaxhighlight lang="xml">
<context-param>
<param-name>org.basex.chopcatalog</param-name> <param-value>falseetc/w3-catalog.xml</param-value>
</context-param>
</syntaxhighlight>
==XML Parsing==
===CHOPSTRIPWS=== {{Announce|Updated with Version 10:}} Renamed (before: {{Code|CHOP}}), new default: {{Code|false}}.
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|CHOP STRIPWS [boolean]}}
|-
| '''Default'''
|{{Code|truefalse}}
|-
| '''Summary'''
|Many XML documents include whitespaces that have been added to improve readability. This option controls the [https://www.w3.org/TR/REC-xml/#sec-white-space white-space processing mode] of the XML parser:
* With If the default value option is set to {{Code|true}}, leading and trailing whitespaces from text nodes will be chopped stripped, and all empty text nodes will be discarded.* The flag should be turned off disabled if a document contains [[Full-Text#Mixed Content|mixed content]].* The flag can also be turned off on via the [[Command-Line Options#BaseX Standalone|command line]] via and <code>-w</code>.* If the option is enabled, whitespaces of an element and its descendants can locally be preserved with the <code>xml:space="preserve"</code> attribute is attached to an element, chopping will be turned off for all descendant text nodes. :
In the following example document, the whitespaces in the text nodes of the {{Code|text}} element will not be chopped:
<syntaxhighlight lang="xml">
<xml>
<title>
Demonstrating the CHOP STRIPWS flag
</title>
<text xml:space="preserve">To <b>be</b>, or not to <b>be</b>, that is the question.</text>
</xml>
</syntaxhighlight>
It is recommendable to additionally assign If whitespaces are stripped, <code>indent=noyes</code> can be assigned to the {{Option|SERIALIZER}} option; otherwise the serialized documents will automatically be to get properly indentedXML output.
|}
|-
| '''Summary'''
|Strips all namespaces from an XML document and all elements while parsing.
|}
|-
| '''Summary'''
|By default, resources specified via [[Databases#XML Documents{{Code|fn:doc]] }} and [[Databases#XML Documents{{Code|fn:collection]] }} are looked up both in the database and in the file system. If you always use {{Function|Database|db:preget}} to access databases, 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.
|-
| '''Summary'''
|If this option is turned on, paths specified in the [[Databases#XML Documents{{Code|fn:doc]] }} and [[Databases#XML Documents{{Code|fn:collection]] }} functions will first be resolved against a database that has been opened in the global context outside the query (e.g. by the {{Command|OPEN}} command). If the path does not match any existing resources, it will be resolved as described in the article on [[Databases#Access Resources|accessing database resources]].
|}
|-
| '''Summary'''
|By activating this option, database instances will be created with the XQuery functions [[Databases#XML Documents{{Code|fn:doc]] }} and [[Databases#XML Documents{{Code|fn:collection]]}}.
|}
|-
| '''Summary'''
|Parameters for [[Serialization|serializing]] query results. The string must comply with the following rules:* Variable names and values must be are separated by equality signs.* Multiple variables must be are delimited by commas.* Commas in values must be duplicatedif they appear as literals in values.
The option can also be used on [[Command-Line Options#BaseX Standalone|command line]] with the flag <code>-s</code>.
|-
| '''Examples'''
|
* <code>indent=noyes</code> : disables enables automatic indentation of XML nodes. This is usually recommended if whitespaces have been stripped from a good choice when working with [[Full-Text#Mixed Contentdocument (see {{Options|Mixed-Content Data]]STRIPWS}}).
* <code>encoding=US-ASCII,omit-xml-declaration=no</code> : sets the encoding to {{Code|US-ASCII}} and prints the XML declaration.
* <code>item-separator=,,</code> : separates serialized items by a single comma.
|-
| '''Summary'''
|Propagates updates on main-memory instances of files that have been retrieved via [[Databases#XML Documents{{Code|fn:doc]] }} and [[Databases#XML Documents{{Code|fn:collection]] }} back to disk:
* This option can also be activated on [[Command-Line Options#BaseX Standalone|command line]] via <code>-u</code>.
* Please take in mind that no backup will be created from your original files.
* Removed: <code>COMPPLAN</code>, <code>IGNOREHOSTNAME</code>
* Updated: {{Option|IGNORECERT}}: Additionally disable hostname verification.
* Updated: {{Option|CATALOG}}: Renamed from <code>(before: {{Code|CATFILE</code>}}).* Updated: {{Option|STRIPWS}}: Renamed (before: {{Code|CHOP}}), new default: false.
;Version 9.7
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu