1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| <?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output encoding="ISO-8859-1" />
<xsl:template match="liste">
<xsl:variable name="critere">
<xsl:if test="$tri_critere='titre'">id</xsl:if>
<xsl:if test="$tri_critere='auteur'">auteur</xsl:if>
<xsl:if test="$tri_critere='date'">date</xsl:if>
</xsl:variable>
<xsl:variable name="ordre">
<xsl:if test="$tri_ordre='croissant'">ascending</xsl:if>
<xsl:if test="$tri_ordre='ascending'">descending</xsl:if>
</xsl:variable>
<xsl:apply-templates select="document(fichier)//ARTICLE/id">
<xsl:sort select="critere" order="ascending"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="id">
<p><b><xsl:value-of select="." /></b></p>
</xsl:template>
</xsl:stylesheet> |