Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

XSLT <xsl:copy> elements


May 28, 2021 XSL T


Table of contents


XSLT and lt;xsl: copy-and-gt; elements

The XSLT-lt;xsl:copy-and-gt; element is used to create a copy of the current node.


XSLT <xsl:copy> elements Complete XSLT element reference manual

Definitions and usages

The element creates a copy of the current node.

Note: The Namespace node of the current node is automatically copied, but the child nodes and properties of the current node are not automatically copied!


Grammar

<xsl:copy use-attribute-sets="name-list">

<!-- Content:template -->

</xsl:copy>

Property

Attributes value describe
use-attribute-sets name-list Optional.If the node is an element, this property is a list of properties set to the output node, separated by spaces.

Instance 1

Copy the message node to the output document:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="message">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

XSLT <xsl:copy> elements Complete XSLT element reference manual

In the next section, you'll learn about the elements of slt;xsl:copy-of-the-gt; Please note the distinction between the elements and the elements of slt;xsl:copy>