[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
Michael Kay wrote:
For attribute nodes the value of the sort key (child::text()) will always be Indeed, I was wondering two things: why xsl:sort could mess up with the attributes and why the text() did not work for the attribute. But I forgot that the attribute axis never has any children.... This behaviour is certainly correct, and I'm not sure which part of it you Well, somehow I hoped that sorting attribute nodes would be a no-op, causing them to appear in the input node's order. It makes sense, I think, considering that ordering attribute nodes does not makes sense: the order of attributes is undefined. But thinking of this again, makes me realize that this is of course a very wrong way of looking at it. I am sorting the nodes and manipulate them after sorting. Surely, sorting attribute nodes makes sense, esp. when you do something else with them then mere copying, where the order can be important (i.e. for attributes-to-xml-elements for instance, or to text output). Incidentally, if any of your child elements contains an embedded comment, Just checked the original project. I appear to do it correctly there (selecting a single node). I just oversimplified a bit ;-) Cheers, -- Abel
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|