Utilisation d'un template
Bonjour,
J'ai un xml comem ci-dessous
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
<?xml version="1.0" encoding="utf-8"?>
<RestrictionAll xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<RestrictionData>
<ClientID>XXXXXXX</ClientID>
<UniqueID>0</UniqueID>
<CodeService>YYYYY</CodeService>
<LienDeco>1</LienDeco>
<Action>ACTIVE</Action>
<KitID>1</KitID>
<TypeData>TTTT</TypeData>
</RestrictionData>
</RestrictionAll> |
Je veux lui appliquer le template
Code:
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
|
<xsl:template name="RestrictionData" match="RestrictionData">Restriction Data:<xsl:value-of select="$newline"/>
<xsl:if test="ClientID">Identifiant client: <xsl:value-of select="ClientID"></xsl:value-of><xsl:value-of select="$newline"/>
</xsl:if>
<xsl:if test="KitID">Identifiant Kit: <xsl:value-of select="KitID"></xsl:value-of><xsl:value-of select="$newline"/>
</xsl:if>
<xsl:if test="UniqueID">Identifiant service: <xsl:value-of select="UniqueID"></xsl:value-of><xsl:value-of select="$newline"/>
</xsl:if>
<xsl:if test="CodeService">Code service restriction: <xsl:value-of select="CodeService"></xsl:value-of><xsl:value-of select="$newline"/>
</xsl:if>
<xsl:if test="LienDeco">Lien de déconnexion: <xsl:value-of select="LienDeco"></xsl:value-of><xsl:value-of select="$newline"/>
</xsl:if>
Type de Restriction :<xsl:choose>
<xsl:when test="TypeData = 'TROISG'">DataRoaming 3G</xsl:when>
<xsl:when test="TypeData = 'MVNO'">DataRoaming MVNO</xsl:when>
<xsl:when test="TypeData = 'WIFI'">WIFI OFF LOAD</xsl:when>
<xsl:otherwise>
<xsl:value-of select="TypeData"></xsl:value-of>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="Action">Action restriction: <xsl:choose>
<xsl:when test="Action = 'ACTIVE'">Activer la restriction</xsl:when>
<xsl:when test="Action = 'DESACTIVE'">Désactiver la restriction</xsl:when>
<xsl:otherwise>
<xsl:value-of select="Action"></xsl:value-of>
</xsl:otherwise>
</xsl:choose><xsl:value-of select="$newline"/>
</xsl:if>
</xsl:template> |
Je rentre bien dans le templaet mais tous les test <xsl:if test=" et le <xsl:choose> ne fonctionne pas et je ne comprend pas pourquoi
J'ai un doute sur l'utilisation du match
Merci d'avance pour votre aide