Specifying Serialization Parameters

Serialization, described in Chapter 22, is the process of writing your query results out to an XML document. Certain syntactic differences may appear when working with different implementations, such as the encoding used, whether an XML declaration is included at the beginning of a document, or whether the results are indented.

The default values for many serialization parameters are implementation-defined. Some implementations will let you specify values for the serialization parameters in a user interface, programmatically, or even as custom option declarations in the query. However, they are not required to provide this capability. As such, there is no XQuery syntax to specify these parameters. Example 23-1 shows how Saxon allows for an implementation-specific option, named output, which allows a query author to set values for serialization parameters in the query itself.

Get XQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.