I need extract <C></C>, by passing a parameter to the xslt like below
<C>
<D></D>
<D></D>
</C>
from the below XML using xslt.
<A>
<B/>
<C>
<D></D>
<D></D>
</C>
<E><D></D></E>
</A>
If I able to set the value for the element as "C", how I able to perform the above operation. My current xslt template like below.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Identity transform -->
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
<xsl:param name="element" />
<xsl:template match="/">
<$element>
<xsl:processing-instruction name="xml-multiple">
<xsl:value-of select="local-name(//D)" />
</xsl:processing-instruction>
<xsl:copy-of select="/A/$element/D" />
</$element>
</xsl:template>
</xsl:stylesheet>