[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl:sort descending causes attribute nodes to be

Subject: Re: 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
Re:  xsl:sort descending causes attribute nodes to be
> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.