Serialization

From BaseX Documentation
Revision as of 00:53, 6 February 2011 by CG (talk | contribs)
Jump to navigation Jump to search

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:

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

external markup declarations.

yes,no,omit omit standalone=yes