This is the mail archive of the xsl-list@mulberrytech.com mailing list .
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Thank you very much! That worked perfectly!
-----Original Message-----
From: Steve Tinney [SMTP:stinney@sas.upenn.edu]
Sent: Sunday, March 12, 2000 9:05 PM
To: xsl-list@mulberrytech.com
Subject: Re: sort, count, number, group
> <artist>
> <recording year="1991">
> <name>Solace</name>
> </recording>
> <recording year="1999">
> <name>Mirrorball</name>
> </recording>
> </artist>
>
> How can I find the name of the most recent recording using XSLT?
<xsl:template match="artist">
<xsl:for-each select="recording">
<xsl:sort data-type="number" order="descending" select="@year"/>
<xsl:if test="position()=1">
<xsl:value-of select="name"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
Steve
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |