Re: [xsl] Re: sorting by maximum value of multiple nodes

Subject: Re: [xsl] Re: sorting by maximum value of multiple nodes
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Thu, 9 Feb 2006 22:43:14 +0530
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="";

<xsl:output method="text" />

<xsl:template match="/employees">
   <xsl:variable name="rtf">
     <xsl:for-each select="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:apply-templates select="common:node-set($rtf)/employee">
     <xsl:sort select="translate(Patent[1]/date,'-','')"
order="descending" data-type="number" />


<xsl:template match="employee">
   <xsl:value-of select="firstName" /><xsl:text>
</xsl:text><xsl:value-of select="lastName"



On 2/9/06, Billie <whynot77@xxxxxxxxxxxx> wrote:
> I'm sorry, I'm using XSLT 1.0.  I should have mentioned that originally.
> Billie

Current Thread