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>
               

            

Learn SQL/XML

Learn how to access and update relational databases using industry-standard SQL/XML technologies along with Stylus Studio's DB-to-XML editor and File Explorer technologies.

SQL/XML Tutorial

Many developers need to be able to write applications that work for databases from multiple vendors. This SQL/XML Tutorial refers to SQL/XML, XQuery, and Native XML Programming Languages to do just that.

XML Schema Validation

Validate XML using XML Schema with MSXML, XERCES, XSV, SYSTEM.XML, & other XSD Validators. Stylus Studio's XML Schema-Aware XML Editing makes XML Schema Validation a snap!

EDIFACT Reference

The EDIFACT Reference is a free developer resource providing the most in-depth information on EDIFACT constructs and data models.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member