The <xsl:copy> Element

The <xsl:copy> element enables you to copy a node from the source tree to the output tree. Note that this is a shallow copy, however, which does not copy any of the node’s descendents or attributes. This element has one attribute:

  • use-attribute-sets . Specifies the names of attribute sets to be applied to a created element. Set to a whitespace-separated list of QNames. You can use the attribute only when the context node is an element; see Chapter 6 for the details on attribute sets.

This element can contain a template body, which is used only when the node to copy is a root node or an element. Note that using <xsl:copy> does nothing when used on the root node, because the root of the output document is created automatically. ...

Get Inside XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.