XSLT : Exportation avec exclusion d'un noeud
Bonjour,
J'ai un fichier xml qui contient des branches "principales" avec des "sous branches".
Dans un traitement, via une feuille xslt, j'exporte une branche complète (ça c'est facile et ça marche très bien).
Le "hic", c'est que je voudrais exclure une sous-branche (le nom de la balise est figé : <Info_Sup>).
Et je ne vois pas comment coder la feuille xsd pour ce faire.
Auriez-vous des suggestions ?
Grand Merci d'avance.
Cordialement.
Fichier XML en Input
Citation:
<Root>
<Branche_01>
...
<Branche_02>
<S_Branche_02_01>
...
<S_Branche_02_02>
...
<Info_Sup>
...
</Info_Sup>
<Branche_03>
...
</Root>
Feuille XSL
Code:
1 2 3 4 5 6 7 8 9
| <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="<a href="http://www.w3.org/1999/XSL/Transform" target="_blank">http://www.w3.org/1999/XSL/Transform</a>" version="1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="/Branche_02">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet> |
Fichier Output actuel
Citation:
<Branche_02>
...
<S_Branche_02_01>
...
<S_Branche_02_02>
...
<Info_Sup>
...
</Info_Sup>
</Branche_02>
Fichier Output XML souhaité : La sous-branche <Info_Sup> n'est pas prise en compte
Citation:
<Branche_02>
...
<S_Branche_02_01>
...
<S_Branche_02_02>
...
</Branche_02>