This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: xsl:template that matches all children of a given node?


Hi,

> Hi there. How would one write an <xml:template match> to copy all of a
> node's children AND THEIR data? I have been able to copy just the nodes, and
> just the data, but copying BOTH seems to be eluding me...

The following XSLT would work:

<xsl:template match="*">
 <xsl:element name="{name()}">
  <xsl:apply-templates/>
 </xsl:element>
</xsl:template>
</xsl:stylesheet>

I think only attributes aren't copied yet.

Bye,

Heiner


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]