|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Q on <xsl:sort>
Simplify your problem to concentrate on what you are asking, and remove the extra junk. I created four timestamps and modified @unix and text() nodes to test the sort. Note the @unix and text() values are not derived from one from the other. Compare the sort order of the following output: 987413416002, 2001-04-16T04:30:35 987413416000, 2001-04-16T04:30:34 987413416001, 2001-04-16T04:30:33 987413416003, 2001-04-16T04:30:32 ------------------------ 987413416003, 2001-04-16T04:30:32 987413416002, 2001-04-16T04:30:35 987413416001, 2001-04-16T04:30:33 987413416000, 2001-04-16T04:30:34 Regards, Dan File: Torres2May2001.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="Torres2May2001.xsl"?> <root> <timestamp unix='987413416003'>2001-04-16T04:30:32</timestamp> <timestamp unix='987413416000'>2001-04-16T04:30:34</timestamp> <timestamp unix='987413416002'>2001-04-16T04:30:35</timestamp> <timestamp unix='987413416001'>2001-04-16T04:30:33</timestamp> </root> File: Torres2May2001.xsl <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates select="root"/> </xsl:template> <xsl:template match="root"> <xsl:for-each select="timestamp"> <xsl:sort select="text()" data-type="text" order="descending"/> <xsl:value-of select="@unix"/>, <xsl:value-of select="text()"/><br/> </xsl:for-each> <hr/> <xsl:for-each select="timestamp"> <xsl:sort select="@unix" data-type="number" order="descending"/> <xsl:value-of select="@unix"/>, <xsl:value-of select="text()"/><br/> </xsl:for-each> </xsl:template> </xsl:stylesheet> __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.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
|

Cart








