[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re-ordering elements
me> NO! despite the capitalisation my description of your propsed code was largely inaccurate I was thrown by the use of the attribute name `id' thinking that you were selecting on id (eg with the id() function) that would have the effect that I described. But your `id' is just an attribute that happens to be called id, and you are accessing it with @ not with id() so the sort keys do vary depending on the node they are evelauated on, but in a strange way. <xsl:for-each select="mantra" > <xsl:sort select="[@id='rv1.84.10a']" /> <xsl:sort select="[@id='rv3.62.10c']" /> <xsl:sort select="[@id='rv1.164.1a']" /> <xsl:sort select="[@id='rv1.164.1e']" /> <xsl:sort select="[@id='rv1.14.1a']" /> </xsl:for-each> on a node which has an id='rv1.84.10a' the value of select="[@id='rv1.84.10a']" is the charactar data of the content of that node. On every other node the value of select="[@id='rv1.84.10a']" is empty. so this will compare the text of the mantra with the empty string. If both nodes don't have that id you will compare two empty strings and so proceed to the next sort. But this is just such a strange way to proceed, you are making the machine go through hoops, and effectively just writing out the full order that you want, eg no for-each and change that xsl:sort to xsl:copy-of David XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|