[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Tempore 00:40:28, die 01/26/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Chaitanya Desai <cdesai@xxxxxxxxxxx>:
<xsl:sort select="xx:node-set($sortkey)//e[position()=count(current()/preceding-sibling::*)+1]"/>
Re: [xsl] generic sort based on attribute names
Subject: Re: [xsl] generic sort based on attribute names From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Wed, 26 Jan 2005 21:17:59 +0100 |
Tempore 00:40:28, die 01/26/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Chaitanya Desai <cdesai@xxxxxxxxxxx>:
I am still not getting the desired output.Oops, little mistake in the predicate:
<xsl:template match="*">should have been:
<xsl:variable name="sortkey">
<xsl:for-each select="*">
<e>
<xsl:for-each select="@*">
<xsl:sort select="name(.)"/>
<xsl:value-of select="name()"/>
</xsl:for-each>
</e>
</xsl:for-each>
</xsl:variable>
<xsl:copy>
<xsl:for-each select="@*">
<xsl:sort select="name(.)"/>
<xsl:copy-of select="."/>
</xsl:for-each>
<xsl:apply-templates>
<!-- the select for this sort needs to be the concatenated name-value pairs of
all the attributes sorted in alphabetical order -->
<xsl:sort select="xx:node-set($sortkey)//e[position()=count(current()/preceding-sibling::*)]"/>
<xsl:sort select="xx:node-set($sortkey)//e[position()=count(current()/preceding-sibling::*)+1]"/>
</xsl:apply-templates> </xsl:copy> </xsl:template>
regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Vincit omnia simplicitas Keep it simple
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] generic sort based on att, Chaitanya Desai | Thread | RE: [xsl] generic sort based on att, Chaitanya Desai |
Re: [xsl] Combining translate() and, Cynthia DeLaria | Date | Re: [xsl] Newbie - XML and XSLT sam, B Tommie Usdin |
Month |