|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Insert an attribute to all nodes.
Hi !
I'm trying to add to every node an attribute.
It's no good idea, but we need it, to be valid to an old dtd.
I tried the following:
<xsl:stylesheet version="1.0"
xslns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="version">
<xsl:value-of select="/PACKAGE/DOCUMENT/@VERSION" />
</xsl:param>
<xsl:template select="*">
<test>
<xsl:element name="self:name">
<xsl:attribute name="VERSION"><xsl:value-of select="$version"
/></xsl:attribute>
<xsl:for-each select="@*">
<xsl:attribute name="self:name"><xsl:value-of select="."
/></xsl:attribute>
</xsl:for-each>
<xsl:apply-templates />
</xsl:element>
</test>
</xsl:template>
</xsl:stylesheet>
I just inserted <test/> to find, what could be wrong.
I alway get the output:
<?xml version="1.0" encoding="UTF-8"?>
<test/>
That's all.
Shouldn't there be all nodes like the original with
<test>s between!?
Some ideas?
Grüße,
Rainer
--
*ProSieben Digital Media
Rainer Jung - Technik/Webmaster
Medienallee 7 - 85774 Unterföhring
Telefon: ++49 (89) 9507-8428
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








