This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Copying unknown attributes in XML to XML transformation?
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Copying unknown attributes in XML to XML transformation?
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Wed, 24 Jan 2001 13:31:13 GMT
- References: <Pine.GSO.4.21.0101241057540.2067-100000@iapetus>
- Reply-To: xsl-list at lists dot mulberrytech dot com
] Try this, Bill:
]
] <xsl:template match="connectionFactory">
] <xsl:element name="connectionFactory">
] <xsl:for-each select="@*">
] <xsl:attribute name="{name(.)}"><xsl:value-of select="."/></xsl:attribute>
] </xsl:for-each>
] <xsl:attribute name="host"><xsl:value-of select="$host"/></xsl:attribute>
] <xsl:attribute name="port"><xsl:value-of select="$port"/></xsl:attribute>
] </xsl:element>
] </xsl:template>
That works, but it is equivalent to the rather shorter
<xsl:template match="connectionFactory">
<connectionFactory host="{$host}" port="{$port}">
<xsl:copy-of select="@*"/>
</connectionFactory>
</xsl:template>
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list