Re: suppress-indentation

We have a winner!

'suppress-indentation' : (QName('|http://xylarium.org/ns/xml/grammars/salix/bibliography|','p'), QName('|http://xylarium.org/ns/xml/grammars/salix/bibliography|','heading‘))

Works for both Morgana and Calabash.

For completeness:

  * a comma-delimited list of URIQualifiedName values works for Calabash
    but not Morgana:
    ('Q{|http://xylarium.org/ns/xml/grammars/salix/bibliography|}p',
    'Q{|http://xylarium.org/ns/xml/grammars/salix/bibliography|}heading')
  * a comma-delimited list of xs:QName values works for Morgana but not
    Calabash: (xs:QName('b:p'), xs:QName('b:heading'))
  * a comma-delimited list of QName constructors works for both Morgana
    and Calabash 🎉 (see above)

I don't know why I didn't think to try a comma-delimited list in round 
brackets (especially before the array) 🙃 as I use them all the time! 
And I'm slightly mortified that I didn't notice that my starting point 
for serialization was an XSLT and XQuery spec!

Achim and Norm, thank you so much for taking the time to respond and 
make suggestions.

Gratefully,
Sheila

On 04/05/2026 17:10, Achim Berndzen wrote:
> Hi Sheila,
> The „substructure“ of the „serialization“ map is indeed tricky as different specs say different things. As you pointed out, "XSLT and XQuery Serialization 3.1“ says "A list of expanded QNames, possibly empty“ (whatever that means in terms of XDM), but"https://www.w3.org/TR/xpath-functions-31/#func-serialize“ gives a 
> detailed XDM based type structure for each value in the map. For "suppress-indentation“ is says:  "xs:QName*“.
>
> As the XProc 3.1 specification leaves a lot about serialisation as „implementation defined“, I took the map infn:serialization as my model.
>
> So:
> <p:set-properties>
>  <p:with-input><demo:doc ><a /></demo:doc></p:with-input>
>          <p:with-option name="properties" select="map{
>              'serialization' : map{
>                  'indent' : true(),
>                  'suppress-indentation' : (xs:QName('demo:doc‘),XS:QName('a‘))            
>              }
>          }" />
>
> does work with MorganaXProc. You can also use "'suppress-indentation' : (QName('http:/www.demo.org','doc'), QName('','a‘)) "
>
>   I have to check whether the other should work, but that MorganaXProc allows [xs:QName,XS:Qname] is definitely a bug.
>
> Hope that helps.
>
> One final remark if you need (or want) to write a pipeline running with XMLCalabash AND MorganaXProc, but encounter differences: I such a case I use the extension attribute „use-when“ testing for the relevant processor. So it would be:
>
> <p:variable name="serialization“ as="map{’suppress-indentation’ : XMLCalabash-variant} use-when="p:system-property('product-name‘) =  'XML Calabash‘“ /> AND
> <p:variable name="serialization“ as="map{’suppress-indentation’ : MorgananaXProc-variant} use-when="p:system-property('product-name‘) =  'MorganaXProc-IIIse'“ />
>
> Greetings from Germany,
> Achim
> ------------------------------------------------
> Achim Berndzen
> achim.berndzen@xml-project.com
>
> <xml-project /> Achim Berndzen
> Kleine Breite 26a
> 38302 Wolfenbüttel, Germany
>
> http://www.xml-project.com
>
>> Am 04.05.2026 um 15:24 schrieb Sheila Thomson<discuss@bluegumtree.com>:
>>
>> 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 viap: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 19:50:00 UTC