Project

Profile

Help

saxon:attribute-order: sorted?

Added by T Hata almost 8 years ago

"saxon:attribute-order":http://www.saxonica.com/documentation/index.html#!extensions/output-extras/serialization-parameters

Attributes whose names are listed in this property appear first, in the order they are listed; other attributes follow, +sorted first by namespace URI and then by local-name+. (underlined by me)

So I tried this xsl


<xsl:stylesheet exclude-result-prefixes="#all" version="2.0"
xmlns:saxon="http://saxon.sf.net/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output saxon:attribute-order="baz" />

<xsl:template name="main">
	<e foo="" baz="" bar="" />
</xsl:template>

</xsl:stylesheet>

expecting @@. (@baz appears first. Other attributes follow, sorted by local-name.)

But the actual outcome was:

P:>java -classpath saxon9ee.jar net.sf.saxon.Transform -it:main -t -xsl:test.xsl
Saxon-EE 9.7.0.12J from Saxonica
Java version 1.8.0_111
...
...

So I'm wondering what the underlined phrase means.


Replies (1)

RE: saxon:attribute-order: sorted? - Added by Michael Kay almost 8 years ago

Thanks - logged as bug #3047 and fixed.

I discovered our unit tests for this were using assert-xml (which compares attributes disregarding order) rather than assert-serialization, which compares the serialized output.

    (1-1/1)

    Please register to reply