Chapter 3. Extensions to the XProc 3.0 standard
MorganaXProc-III's implementation of XProc 3.0 has a number of
features extending the XProc 3.0 standard. The namespace for all extensions is http://www.xml-project.com/morganaxproc
. In
this documentation the prefix mox
is used for this namespace.
1. Serialization options
MorganaXProc-III implements some extensions to serialize documents.
1.1. Serialization parameter 'mox:indent-spaces'
With output methods XML, HTML, and XHTML and 'indent' :
true()
, the 'mox:indent-spaces
' key can be used
to control the amount of indentation. The key must be associated with an
instance of xs:integer
. The setting is ignored, if the
integer value if less than 1. The default value for indentation is 3.
This feature can be used in any serialization
map in XProc
as well as with a map as second parameter in
fn:serialization#2
.
1.2. Serialization parameter 'mox:indent-arrays'
When serializing JSON documents with 'indent' : true()
,
parameter 'mox:indent-arrays
' can be used to control whether
JSON arrays are indented or not. The default value is true()
,
but with setting the parameter to false()
indentation of
arrays is suppressed.
1.3. Serialization parameter 'mox:sort-attributes' (EE only)
For serialization method 'xml', 'html', and 'xhtml' you can use key/pair
'mox:sort-attributes' : true()
to ask for a sorted
serialization of all attributes on all elements. When sorting, attribute's namespace
uri is used first, local name comes second. Prefixes are not taken into account which
might lead to contra intuitive results when looking at prefixed attributes.