|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: copy of attributes
Hi, news@xxxxxxxxxxx,
Thursday, October 21, 2004, 12:41:52 PM:
nsd> Hello List,
nsd> I want to performe a copy of an nodesets attributes. I can'nt use
nsd> xsl:copy-of, because I dont want to copy all the child nodes. Is it possible
nsd> to do this? Or do I have to copy each attribute manually by doing something
nsd> like this:
nsd> <node>
nsd> <xsl:attribute name="attr"><xsl:value-of
nsd> select="@attr"/></xsl:attribute>
nsd> </node>
For example:
<xsl:template name="attributes">
<xsl:for-each select="attribute::*">
<xsl:attribute name="{name()}">
<xsl:value-of select="self::node()"/>
</xsl:attribute>
</xsl:for-each>
</xsl:template>
<xsl:template match="node">
<node>
<xsl:call-template name="attributes"/>
</node>
</xsl:template>
--
Best regards,
Andrey V. Elsukov
|
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








