xsl:copy

Adds a copy of the current node to the result tree.

Format

<xsl:copy>copy_contents</xsl:copy>
               

            

Description

The copy includes the current node's namespace information but does not include the current node's attributes or children. The contents of the xsl:copy element is a template for the attributes and children of the node being created. If the current node cannot have attributes or children (that is, if it is an attribute, text, comment, or processing instruction node), the content of the instruction is ignored.

If the current node is the root node, the XSLT processor does not create a root node. Instead, it uses copy_contents as a template.

Example

Following is an example from the W3C XSLT Recommendation. It generates a copy of the source document.

<xsl:template match="@* | node() ">
               

              
<xsl:copy>
                   
<xsl:apply-templates select="@* | node() " />
                   
</xsl:copy>
                   

                
</xsl:template>

XML Whitepapers

Learn how XML can help you meet your business objectives by reading free XML Whitepapers covering XML, XML Schema, XQuery, SQL/XML, and FIXML technolgies employed in real world case studies.

EAI - Enterprise Application Integration

Using EAI tools included with Stylus Studio it's easy to unlock silos of enterprise data and seamlessly integrate it into your IT applications.

Export HTML to XML

Export HTML to XML with the click of a button - simplify migration of legacy HTML code to industry standard XML technologies with Stylus Studio.

Translating XML documents to X12

In-place, via XSLT and via XQuery are all mechanisms supported for converting XML to X12

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member