Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#739 xsl:message and attribute nodes

Michael Kay
Michael Kay

What should <xsl:message select="@*"/> do? The specification doesn't really say. Saxon 8.9 and previous releases output a sequence of name-value pairs, for example

a="foo" b="bar"

Saxon 9.0 throws an error "XTDE0420: Cannot create an attribute node (attribute) whose parent is a document node"

On the whole, the Saxon 8.9 action seems friendlier, though what 9.0 is doing is very logical according to the specification.

This only ever worked in the first place by accident, as it was exploiting the fact that TreeReceiver wasn't checking its arguments carefully enough.

I'm putting a patch in Subversion that stops this throwing an error. It will now output the attributes in the form of processing instructions:

It will also do this if you try (in xsl:message) to output attributes or namespaces anywhere where there isn't an element start tag to attach them to.

I've raised a bug on the spec to try to get a clarified definition of what ought to happen, so the solution may change again in the future.


  • Michael Kay
    Michael Kay

    Logged In: YES
    Originator: YES

    Fixed in