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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| <?xml version="1.0" encoding="ISO-8859-15"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="ISO-8859-15" indent="yes"/>
<xsl:template match="node()" priority="1">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<!-- règles pour les contenus de balise : on recopie -->
<xsl:template match="text()" priority="1">
<xsl:value-of select="."/>
</xsl:template>
<!-- regle pour les balises : on recopie -->
<xsl:template match="@*" priority="1">
<xsl:attribute name="{name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="ObjetRecupere" priority="1">
<xsl:copy>
<xsl:apply-templates select="Application|Site|Message"/>
<xsl:variable name="identifiant"><xsl:value-of select="*/Identifiant_absolu"/></xsl:variable>
<xsl:for-each select="Lien">
<xsl:call-template name="EcrireLien">
<xsl:with-param name="source" select="$identifiant"/>
<xsl:with-param name="nom">
<xsl:value-of select="@type"/>
</xsl:with-param>
<xsl:with-param name="destination">
<xsl:value-of select="."/>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:copy>
</xsl:template>
<xsl:template name="EcrireLien">
<xsl:param name="nom"/>
<xsl:param name="source"/>
<xsl:param name="destination"/>
<Lien>
<Nom><xsl:value-of select="$nom"/></Nom>
<ID_Source><xsl:value-of select="$source"/></ID_Source>
<ID_Destination><xsl:value-of select="$destination"/></ID_Destination>
</Lien>
</xsl:template>
<xsl:template match="Application">
<xsl:apply-templates select="node()|@*"/>
</xsl:template>
<xsl:template match="Message">
<xsl:apply-templates select="node()|@*"/>
</xsl:template>
<xsl:template match="Site">
<xsl:apply-templates select="node()|@*"/>
</xsl:template>
</xsl:transform> |