This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Adding attributes
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 7 Feb 2002 14:43:27 GMT
- Subject: Re: [xsl] Adding attributes
- References: <60A8664AEEB2D511B631000476AAB1A395FE97@ma-atl81>
- Reply-to: xsl-list at lists dot mulberrytech dot com
this'll work:
<xsl:template match="myelement">
<xsl:copy>
<xsl:copy-of select="attribute::*"/>
<xsl:attribute name="color">blind</xsl:attribute>
That's OK although you can also do
<xsl:template match="myelement">
<myelement color="blind">
<xsl:copy-of select="@*"/>
However beware
<xsl:copy-of select="descendant::*"/>
that would expand out all the nodes below the current node, normally
you'd just want <xsl:copy-of select="node()"/>
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list