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

RE: <xsl:sort> using a derived element

Subject: RE: <xsl:sort> using a derived element
From: "RUSSO, EDITH" <EDIRUS@xxxxxxxxxx>
Date: Wed, 7 Mar 2001 07:48:20 -0800
sort elements in combobox
Jeni,

Before I saw your reply, I saw Mike Kay's reply and did it a little
differently than what you had suggested below.  Both work, is that the case
a lot of the time?  This is a trivial combobox, but how should I decide
which way to implement something similar to this in the future?  What I did
was added /Itm to the end of the xsl:apply-templates and xsl:template
statements and took out the xsl:for-each:

<xsl:apply-templates select="PATHFINDER/List[ListID='102000']/Itm">
	<xsl:sort select="substring-after(ItmDesc,'-')" order="ascending"/>
</xsl:apply-templates>
<xsl:template match="PATHFINDER/List[ListID='102000']/Itm">
	<OPTION><xsl:attribute name="value"><xsl:value-of select="ItmID"/>
</xsl:attribute><xsl:value-of select="substring-after(ItmDesc,'-')"/>
</OPTION>
</xsl:template>

Thanks!

Edith

>What I think you want to do is simply move the xsl:sort element from
>the xsl:apply-templates in the first template and put it as the first
>child of the xsl:for-each element in the template above.  You'll then
>have:

>  <xsl:for-each select="Itm">
>     <xsl:sort select="substring-after(ItmDesc, '-')"
>               order="ascending" />
>     ...
>  </xsl:for-each>

>That will iterate through the Itm elements, sorted according to the
>string after the '-' in the ItmDesc children of the Itm elements.
>Which should work fine.

>I hope that helps,

>Jeni

>---
>Jeni Tennison
>http://www.jenitennison.com/




 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.