|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: sorting by maximum value of multiple nodes
Hi Billie,
Please find below the XSLT 1.0 solution. I have used the node-set
extension function, which is usually available in popular XSLT
processors, namely Saxon and Xalan. I don't know which XSLT processor
you are using.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:common="http://exslt.org/common"
version="1.0">
<xsl:output method="text" />
<xsl:template match="/employees">
<xsl:variable name="rtf">
<xsl:for-each select="employee">
<employee>
<xsl:copy-of select="*[not(self::Patent)]" />
<xsl:for-each select="Patent">
<xsl:sort select="translate(date,'-','')"
order="descending" data-type="number" />
<xsl:copy-of select="." />
</xsl:for-each>
</employee>
</xsl:for-each>
</xsl:variable>
<xsl:apply-templates select="common:node-set($rtf)/employee">
<xsl:sort select="translate(Patent[1]/date,'-','')"
order="descending" data-type="number" />
</xsl:apply-templates>
</xsl:template>
<xsl:template match="employee">
<xsl:value-of select="firstName" /><xsl:text>
</xsl:text><xsl:value-of select="lastName"
/><xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Regards,
Mukul
On 2/9/06, Billie <whynot77@xxxxxxxxxxxx> wrote:
> I'm sorry, I'm using XSLT 1.0. I should have mentioned that originally.
> Billie
|
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








