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

Re: Re-ordering elements

Subject: Re: Re-ordering elements
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 20 Jan 2000 21:18:46 GMT
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


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.