1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version="1.0">
<xsl:output method="text"/>
<xsl:template match="annuaire/personne">
<xsl:apply-templates select="personne"/>
<xsl:call-template name="printName">
<xsl:with-param name="a" select="VC" />
<xsl:with-param name="b"/>
</xsl:call-template>
</xsl:template>
<!--fonction-->
<xsl:template name="printName">
<xsl:param name="a"/>
<xsl:param name="b" select="nom" />
<xsl:choose>
<xsl:when test="@name = $a">
<xsl:value-of select="$b"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>N/A</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet> |