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 30 31 32 33 34 35 36 37 38
| <?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="client">
<client>
<xsl:apply-templates/>
</client>
</xsl:template>
<xsl:template match="service">
<service>
<xsl:apply-templates/>
</service>
</xsl:template>
<xsl:template match="data">
<data>
<xsl:apply-templates/>
</data>
</xsl:template>
<xsl:template match="nom">
<xsl:variable name="index" select="text()"/>
<xsl:choose>
<xsl:when test="//service[1]/text()=concat('SVC',$index)"></xsl:when>
<xsl:otherwise>
<nom>
<xsl:apply-templates/>
</nom>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet> |
Partager