[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: <xsl:sort> using a derived element
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
|
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
|