How to we use xsl:copy element in XSLT

It article help you to determine the use of xsl:copy element.
  • 1905

The xsl:copy elements copies the current node in to the output.The copy has the same name, namespace, and type as the original node,but child nodes and attributes of the current node are not automatically copied.It is support to IE 5.0 and FF 1.0.

Syntax of xsl:copy element

<xsl:copy user-attribute-set="NAMES">

  <xsl:apply-templates select="something">

    <xsl:apply-templetes/>

  </xsl:copy/>

It have contain only one attribute

  •  user-attribute-sets

                   It is an optional attribute.The user-attribute-sets attribute performs the same purpose as the xsl:attribute element.

Example of  copy the abc to message node

<xsl:stylesheet xmlns:xsl="http://www.google.com/XSL/Transform" version="1.0">

  <xsl:template match="abc">

    <xsl:copy>

      <xsl:apply-templates select="abc" />

    </xsl:copy>

  </xsl:template>

</xsl:stylesheet>

Further Readings

You may also want to read these related articles :

Ask Your Question 

Ask Your Question Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.