XSLT <xsl: copy> element
Definition and Usage
<Xsl: copy> element creates a copy of the current node.
Note: Namespace current node are automatically copied, but the current child nodes and attribute nodes will not be automatically copied!
grammar
<xsl:copy use-attribute-sets="name-list">
<!-- Content:template -->
</xsl:copy>
<!-- Content:template -->
</xsl:copy>
Attributes
属性 | 值 | 描述 |
---|---|---|
use-attribute-sets | name-list | 可选。如果该节点是元素,则该属性是应用到输出节点的属性集列表,由空格分隔。 |
Example 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>
<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>
Complete XSLT Element Reference Manual