Subject: Re: [xsl] xsl:sort descending causes attribute nodes to be created after children, causing an error From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 16 Jan 2007 13:13:53 GMT |
> The following issue is easy to workaround, but I am wondering if this is > correct behavior after the XSLT 2 (or even 1) recommendation. yes that's the expected behaviour (although of course it's nothing really to do with the xsl:sort, a more direct case is <x> hello <xsl:attribute name="x"/> In 1.0 it's a recoverable error (with the alternative of ignoring the attribute) section 7.1.3 Adding an attribute to an element after children have been added to it; implementations may either signal the error or ignore the attribute. in 2.0 it's a hard error, section 5.7.1 [ERR XTDE0410] It is a non-recoverable dynamic error if the result sequence used to construct the content of an element node contains a namespace node or attribute node that is preceded in the sequence by a node that is neither a namespace node nor an attribute node. > Any thoughts on this? Is this behavior desired and/or required, or is > this the processor's mistake? It's required to allow an implemenation to start serialising the result tree before processing is finished. If you were allowed to generate an entire document then generate a version="2" attribute as the last node before closing teh document element, the processor would always haveto buffer the entire result tree in memory just in case the system did this. David
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] xsl:sort descending causes at, Abel Braaksma | Thread | Re: [xsl] xsl:sort descending cause, Abel Braaksma |
[xsl] xsl:sort descending causes at, Abel Braaksma | Date | RE: [xsl] xsl:sort descending cause, Michael Kay |
Month |