1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">
<xsl:template match="/">
<res>
<xsl:variable name="orderedActus">
<tri>
<xsl:apply-templates select="noeud/actu" mode="intern">
<xsl:sort select="concat(substring(date,7,11),substring(date,3,5),substring(date,1,2))"
order="descending" data-type="text"/>
</xsl:apply-templates>
</tri>
</xsl:variable>
<xsl:copy-of select="exsl:node-set($orderedActus)/tri/actu[1]"/>
</res>
</xsl:template>
<xsl:template match="actu" mode="intern">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet> |