Difference between revisions of "Serialization"
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
==Parameters== | ==Parameters== | ||
− | {| class="wikitable" | + | The following table gives a brief summary of all serialization parameters supported by BaseX. For details, please refer to official specification. |
+ | |||
+ | {| class="wikitable" width="100%" | ||
|- valign="top" | |- valign="top" | ||
− | ! | + | ! Parameter |
! Description | ! Description | ||
− | ! | + | ! Restrictions |
+ | ! Default | ||
+ | ! Examples | ||
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>version</code> |
− | | XML Version | + | | XML Version. |
− | | version=1.0 | + | | <code>1.0,1.1</code> |
+ | | <code>1.0</code> | ||
+ | | <code>version=1.0</code> | ||
+ | |- valign="top" | ||
+ | | <code>encoding</code> | ||
+ | | Encoding to be used for outputting the data. | ||
+ | | | ||
+ | | <code>UTF-8</code> | ||
+ | | <code>encoding=US-ASCII</code> | ||
+ | |- valign="top" | ||
+ | | <code>indent</code> | ||
+ | | Adjust whitespaces to make the output better readable. | ||
+ | | <code>yes,no</code> | ||
+ | | <code>yes</code> | ||
+ | | <code>indent=no</code> | ||
+ | |- valign="top" | ||
+ | | <code>cdata-section-elements</code> | ||
+ | | List of elements to be output as CDATA, separated by whitespaces. | ||
+ | | | ||
+ | | | ||
+ | | <code>cdata-section-elements=text</code> | ||
+ | |- valign="top" | ||
+ | | <code>omit-xml-declaration</code> | ||
+ | | Omits the XML declaration, which is serialized before the actual query result. | ||
+ | | <code>yes,no</code> | ||
+ | | <code>yes</code> | ||
+ | | <code>omit-xml-declaration=no</code> | ||
+ | |- valign="top" | ||
+ | | <code>standalone</code> | ||
+ | | Prints or omits the "standalone" attribute in the XML declaration, which states if the document has | ||
+ | [http://www.w3.org/TR/REC-xml/#sec-rmd external markup declarations]. | ||
+ | | <code>yes,no,omit</code> | ||
+ | | <code>omit</code> | ||
+ | | <code>standalone=yes</code> | ||
|} | |} |
Revision as of 00:53, 6 February 2011
Serialization parameters define how XQuery items and XML nodes are textually output, i.e., serialized. They have been formalized in the W3C XQuery Serialization 3.0 document. In BaseX, they can be specified in several ways:
- by using the
-s
flag of the BaseX command-line clients, - by setting the SERIALIZER option before running a query,
- by setting the EXPORTER option before exporting a database,
- by setting them via the Output Parameter of the JAX-RX API,
- by including them in the prolog of the XQuery expression (since XQuery 3.0), or
- by specifying them in the XQuery function file:write().
Parameters
The following table gives a brief summary of all serialization parameters supported by BaseX. For details, please refer to official specification.
Parameter | Description | Restrictions | Default | Examples |
---|---|---|---|---|
version
|
XML Version. | 1.0,1.1
|
1.0
|
version=1.0
|
encoding
|
Encoding to be used for outputting the data. | UTF-8
|
encoding=US-ASCII
| |
indent
|
Adjust whitespaces to make the output better readable. | yes,no
|
yes
|
indent=no
|
cdata-section-elements
|
List of elements to be output as CDATA, separated by whitespaces. | cdata-section-elements=text
| ||
omit-xml-declaration
|
Omits the XML declaration, which is serialized before the actual query result. | yes,no
|
yes
|
omit-xml-declaration=no
|
standalone
|
Prints or omits the "standalone" attribute in the XML declaration, which states if the document has | yes,no,omit
|
omit
|
standalone=yes
|