suppress-indentation

Hi all,

I'm trying to make sure that a pipeline can be run using either Morgana 
or Calabash but have hit a problem with setting the 
'suppress-indentation' property for an XML document via 
p:set-properties. I can't find a way to express the value that both 
processors will accept.

Below is a longish summary of my reading of the specs where, ultimately, 
TL;DR, I have yet to find clear guidance on the form that the *value* of 
'suppress-indentation' should take *in XProc*/. /My hope is that someone 
will reply back with a link to the exact spot where this is defined and 
then I will know whether the bug is mine (probably) or in one of the 
processors (possibly).

In the latest version of the XSLT and XQuery Serialization 3.1 spec, 
/Β§ 3 Serialization 
Parameters/ (https://www.w3.org/TR/xslt-xquery-serialization-31/#serparam), 
all it says is that the value of 'suppress-indentation' must be "A list 
of expanded QNames, possibly empty."

/XProc 3.1: Standard Step Library/ /Β§ 2.29 p:set-properties 
/(https://spec.xproc.org/3.1/steps/#c.set-properties, Community Group 
Report 30 May 2025) specifies that the set of document properties must 
be supplied as a map: map(xs:QName, item()*) and that the value of 
the 'serialization' key-value pair must also either be a map or be 
convertible to a map according to the rules in section "QName handling" 
of XProc 3.1.

The edition of XProc 3.1 linked to from /Β§ B.1. Normative 
References/ doesn't include a section *titled* /QName handling/ but it 
does include /Β§ 11.5.1 Special rules for casting QNames/ which has the 
fragment ID #qname-handling πŸŽ‰ 
(https://spec.xproc.org/lastcall-2024-08/head/xproc/#qname-handling). 
The first half of that section appears to be about how QNames may be 
written when they need to be used to specify an option value, via an 
attribute, eg. p:add-attribute/@attribute-name. The second half appears 
to be about how QNames may be written when used as a *key* in a map.

So far, per the specs, I believe that the step should be written:

<p:set-properties>
         <p:with-option name="properties" select="map{
             'serialization' : map{
                 'indent' : true(),
                 'suppress-indentation' : item()*
             }
         }" />
     </p:set-properties>

But that item()* should more specifically be zero-or-more "expanded 
QNames, possibly empty".  But no guidance yet on how the items in the 
list should be delimited.  I tried searching both parts of the XProc 3.1 
spec for mentions of 'suppress-indentation' but found nothing else that 
helped.

Many paragraphs into /XSL Transformation (XSLT) Version 3.0 Β§ 25.1 
Creating Secondary Results/ 
(https://www.w3.org/TR/xslt-30/#creating-result-trees) there is a very 
helpful note that states: "In the case of the attributes method, 
cdata-section-elements, suppress-indentation, and use-character-maps, 
the effective value of the attribute contains a space-separated list of 
EQNames." Although there's no reason why an XProc processor should 
conform to this XSLT rule, it's a starting point.

The definition of EQName in /XML Path Language (XPath) 3.1 
/(https://www.w3.org/TR/xpath-31/#doc-xpath31-EQName) is:

EQName ::= QName | URIQualifiedName

Which depends on these further definitions in /Namespaces in XML 1.0 
(Third Edition)/ (https://www.w3.org/TR/REC-xml-names/#NT-QName):

QName ::= PrefixedName | UnprefixedName
PrefixedName ::= Prefix ':' LocalPart
UnprefixedName ::= LocalPart
Prefix ::= NCName
LocalPart ::= NCName
NCName ::= Name - (Char* ':' Char*)

And (from XPath 3.* again)

URIQualifiedName ::= BracedURILiteral NCName
BracedURILiteral ::= "Q" "{" [^{}]* "}"

According to the above, if XProc also supports a space-separated list of 
EQNames, then both of these forms should be acceptable:

*1. 'b:p b:title b:citation'*

*2. '|Q{http://xylarium.org/ns/xml/grammars/salix/bibliography}p 
Q{http://xylarium.org/ns/xml/grammars/salix/bibliography}heading'|*

I tried form one first, using PrefixedName as the elements are in a 
namespace (which is bound to the 'b' prefix within this XProc step):

'suppress-indentation' : 'b:p b:title b:citation'

Both processors throw an error:

  * Calabash:|Invalid value, or combination of values, in serialization
    options. cause: java.lang.IlliegalArgumentException: Value of
    {suppress-indentation] must be a list of QNames in β€˜Q{uri}local’
    notation|
  * Morgana: Error in serialization parameters
    ({http://www.w3.org/2005/xqt-errors}XPTY0004): xs:qname* expected
    for serialization parameter 'suppress-indentation'.

Then form two (URIQualifiedName):

'suppress-indentation' : 
'Q{http://xylarium.org/ns/xml/grammars/salix/bibliography}p 
Q{http://xylarium.org/ns/xml/grammars/salix/bibliography}title 
Q{http://xylarium.org/ns/xml/grammars/salix/bibliography}citation'

Which Calabash accepts πŸŽ‰ but Morgana throws the same error πŸ˜•

I start to think about how else the list might be expressed, given that 
in XProc it's a value in a map, rather than of an attribute, so I try:

*3. An array of QName constructor functions:*

'suppress-indentation' : 
[QName('http://xylarium.org/ns/xml/grammars/salix/bibliography', 'p'), 
QName('http://xylarium.org/ns/xml/grammars/salix/bibliography', 
'title'), 
QName('http://xylarium.org/ns/xml/grammars/salix/bibliography', 'citation')]

Which Morgana accepts πŸŽ‰ but Calabash throws an error πŸ˜•:

  * Calabash: Invalid value, or combination of values, in serialization
    options. cause: net.sf.saxon.trans.UncheckedXPathException: An array
    has no string value

In desperation, I try:

*4. An array of URIQualifiedName values:*

'suppress-indentation' : 
['Q{http://xylarium.org/ns/xml/grammars/salix/bibliography}p', 
'Q{http://xylarium.org/ns/xml/grammars/salix/bibliography}title', 
'Q{http://xylarium.org/ns/xml/grammars/salix/bibliography}citation']

Both processors throw an error:

  * Calabash: Invalid value, or combination of values, in serialization
    options. cause: net.sf.saxon.trans.UncheckedXPathException: An array
    has no string value
  * Morgana:Error in serialization parameters
    ({http://www.w3.org/2005/xqt-errors}XPTY0004): xs:qname[] expected
    for serialization parameter 'suppress-indentation'.

Clearly Calabash is expecting the list to be in a string (option 2, 
above) but Morgana only seems to accept the list as an array (option 3, 
above).

*Which of the above options (or other option) should work with both 
processors?*

Stumped,

Sheila

Received on Monday, 4 May 2026 13:24:23 UTC