1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="map" select="document('transcodage.xml')"/>
<xsl:key name="mapPorts" match="/mapping/portype/item" use="@v1"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@SR[parent::RAS]">
<xsl:variable name="codeV1" select="."/>
<xsl:for-each select="$map">
<xsl:attribute name="SR">
<xsl:value-of select="key('mapPorts', $codeV1)/@v3"/>
</xsl:attribute>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet> |