XML Development

Moderators: None (Apply to moderate this forum)
Number of threads: 252
Number of posts: 451

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
xsl:sort with multiple elements? Posted by GameFreak7744 on 25 May 2006 at 1:13 PM
Is it possible to use xsl:sort to sort things based on multiple XML elements, like a datestamp split into <day>, <month> and <year>?
If so, how is this done?

Thanks in advance for any help.
~Joey~
Report
Re: xsl:sort with multiple elements? Posted by infidel on 31 May 2006 at 2:45 PM
: Is it possible to use xsl:sort to sort things based on multiple XML elements, like a datestamp split into <day>, <month> and <year>?
: If so, how is this done?
:
: Thanks in advance for any help.

Just use multiple xsl:sort elements:

<xsl:for-each select="nodes/node">
    <xsl:sort select="datestamp/year" data-type="number" order="ascending" />
    <xsl:sort select="datestamp/month" data-type="number" order="ascending" />
    <xsl:sort select="datestamp/day" data-type="number" order="ascending" />

    <output/>

</xsl:for-each>



infidel

$ select * from users where clue > 0
no rows returned





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.