[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: <xsl:sort> using a derived element
Hi Jeni! Since I'm not doing exactly what you mentioned, I put in more snippets and a better picture of the data... <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> ... <tr> <td>Office: </td> <td><SELECT id="office"> <xsl:apply-templates select="PATHFINDER/List[ListID='102000']"> <xsl:sort select="substring-after(ItmDesc,'-')" order="ascending"/> </xsl:apply-templates> </SELECT> </td> </tr> ... <xsl:template match="PATHFINDER/List[ListID='102000']"> <xsl:for-each select="Itm"> <OPTION><xsl:attribute name="value"><xsl:value-of select="ItmID"/> </xsl:attribute><xsl:value-of select="substring-after(ItmDesc,'-')"/> </OPTION> </xsl:for-each> </xsl:template> <PATHFINDER version="2000"> <List> <ListID>102000</ListID> <ListDesc>Legal Office</ListDesc> <Itm> <ListID>102000</ListID> <ItmID>102020</ItmID> <ItmDesc>020-Glendale</ItmDesc> </Itm> <Itm> <ListID>102000</ListID> <ItmID>102021</ItmID> <ItmDesc>021-Ventura</ItmDesc> </Itm> </List> </PATHFINDER> //What you have should work as long as the ItmDesc elements are children of //the elements that you're sorting. You should have something like: // <xsl:for-each select="Itm"> // <xsl:sort select="substring-after(ItmDesc, '-')" // order="ascending" /> // ... // </xsl:for-each> //with the source being something like: // <Itm> // <ItmDesc>214-Spokane</ItmDesc> // </Itm> // <Itm> // <ItmDesc>534-Hullabaloo</ItmDesc> // </Itm> //I guess another possibility would be that you might be using the old //MSXML namespace rather than the XSLT namespace? 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
|