Tell me what is Identity template in XSL, why do you use it?

Submitted by: Muhammad
Identity template in XSL is used to create deep copy of source XML file. It's template matches to every node() and attribute and copy everything to create copy of original xml file. many people define Identity template in its own file like Identity.xsl but some people also preferred to keep in main XSL file as top template. Identity template has several uses in XSL transformation, like if you want to remove any attribute or element you will most likely copy everything using Identity template and create another template for not doing anything for those attribute or elements.

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

Above template is called Identity template. If you look at definition first template matches any attribute or
any node and then copies current node including any attributes and child nodes.
Submitted by: Muhammad

Read Online XSLT Job Interview Questions And Answers