[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
I've tried all sorts of methods and I just can't figure it out. I'm wondering if I'm missing some fundamental understanding about how sort works in xsl.
And I need to be able to sort them (on the fly - it's part of a sortable table in html) in this order and the reverse:
active, not published
active, published
not active, published
not active, not published.
I've tried all kinds of ways to sort them to get this to happen including brute force:
<xsl:for-each select="project">
<xsl:sort select="@active=1 and @published=0" order="ascending"
data-type="number"/>
<xsl:sort select="@active=1 and @published=1" order="ascending"
data-type="number"/>
<xsl:sort select="@active=0 and @published=1" order="ascending"
data-type="number"/>
<xsl:sort select="@active=0 and @published=0" order="ascending"
data-type="number"/>
<xsl:copy-of select="."/>
</xsl:for-each>
Nothing works. It always comes out with at least one in the wrong spot.
Could someone point me in the right direction? Help me understand what I'm missing about how sort works?
[xsl] Sorting on two booleans
Subject: [xsl] Sorting on two booleans From: Joelle Tegwen <tegwe002@xxxxxxx> Date: Thu, 26 Feb 2009 11:22:37 -0600 |
I've tried all sorts of methods and I just can't figure it out. I'm wondering if I'm missing some fundamental understanding about how sort works in xsl.
I've got a document that looks like this: <projects> <project active="1" published="1">stuff</project> <project active="1" published="0">stuff</project> <project active="0" published="1">stuff</project> <project active="0" published="0">stuff</project> </projects
And I need to be able to sort them (on the fly - it's part of a sortable table in html) in this order and the reverse:
active, not published
active, published
not active, published
not active, not published.
I've tried all kinds of ways to sort them to get this to happen including brute force:
<xsl:for-each select="project">
<xsl:sort select="@active=1 and @published=0" order="ascending"
data-type="number"/>
<xsl:sort select="@active=1 and @published=1" order="ascending"
data-type="number"/>
<xsl:sort select="@active=0 and @published=1" order="ascending"
data-type="number"/>
<xsl:sort select="@active=0 and @published=0" order="ascending"
data-type="number"/>
<xsl:copy-of select="."/>
</xsl:for-each>
Nothing works. It always comes out with at least one in the wrong spot.
Could someone point me in the right direction? Help me understand what I'm missing about how sort works?
Thanks much in advance Joelle
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Atypical list, Konstanty Pilecki | Thread | RE: [xsl] Sorting on two booleans, Michael Kay |
RE: [xsl] xmlns created literally, Christopher R. Maden | Date | RE: [xsl] Sorting on two booleans, Michael Kay |
Month |