Changes

Jump to navigation Jump to search
144 bytes removed ,  17:39, 1 December 2023
m
Text replacement - "syntaxhighlight" to "pre"
The namespace for serialization parameters is statically bound to the {{Code|output}} prefix. This means that it need not (but may) be declared in the query prolog:
<syntaxhighlight pre lang="'xquery"'>
declare namespace output = 'http://www.w3.org/2010/xslt-xquery-serialization';
declare option output:method 'text';
<xml>Hi there</xml>
</syntaxhighlightpre>
Due to the wide range of ways how parameters can be supplied, we deliberately ignored one rule of the specification, which requires non-official features to be defined in a non-null namespace URI. In the following, we will indicate which features are specific to our implementation.
The {{Code|csv}} and {{Code|json}} parameters are supplied with a list of options. Option names and values are combined with <code>=</code>, several options are separated by <code>,</code>:
<syntaxhighlight pre lang="'xquery"'>
declare option output:method "csv";
declare option output:csv "header=yes, separator=semicolon";
</record>
</csv>
</syntaxhighlightpre>
If {{Code|fn:serialize}} is called, output-specific parameters can be supplied via nested options:
<syntaxhighlight pre lang="'xquery"'>
serialize(
<csv>
}
)
</syntaxhighlightpre>
'''Result''':
<syntaxhighlight pre lang="xml">
Name;City
John;Newton
Jack;Oldtown
</syntaxhighlightpre>
=Character mappings=
'''Example query''':
<syntaxhighlight pre lang="'xquery"'>
declare option output:parameter-document "map.xml";
<x>&amp;#xA0;</x>
</syntaxhighlightpre>
'''Example parameter-document''':
<syntaxhighlight pre lang="xml">
<serialization-parameters
xmlns="http://www.w3.org/2010/xslt-xquery-serialization">
</use-character-maps>
</serialization-parameters>
</syntaxhighlightpre>
=Changelog=
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu