Bonjour à tous,
je me heurte à un problème de déclaration de namespace dans un tag de doc xml.
voilà mon doc initial :
1 2 3
| <?xml version='1.0' encoding='utf-8' ?>
<loader xmlns:gxs="gxs-script" xmlns:sfs="filter-script"
.... |
et voilà ce que je voudrais rajouter :
1 2 3
| <?xml version='1.0' encoding='utf-8' ?>
<loader xmlns:bench="bench-script" xmlns:gxs="gxs-script" xmlns:sfs="filter-script"
... |
Ma feuille de style est la suivante :
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
| <?xml version='1.0'?>
<xsl:stylesheet version="1.0"
..
xmlns:otacs="otacs-script"
xmlns:bench="bench-script"
exclude-result-prefixes="sfs sss ota resolver http sola5 imd bvfilter presat maxbufsize monitor bench otacs ">
<xsl:template match="/loader">
<xsl:copy>
<xsl:attribute name="bench" namespace="bench-script" />
<xsl:apply-templates select="@* | * | text() | comment()" />
</xsl:copy>
</xsl:template>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@* | * | text() | comment()">
<xsl:copy>
<xsl:apply-templates select="@* | * | text() | comment()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet> |
et voilà ce que j'obtiens :
<loader ns0:bench="" xmlns:gxs="gxs-script" xmlns:ns0="bench-script" ...
Visiblement ça doitr pas être ça ...
Partager