I am trying to develop an XSLT stylesheet which will transform an xml into another by keeping in view:
In other words, identity transform only the elements explicitly specified.
Well, to do nothing for most, surely something like:
<xsl:template match="/*">
<xsl:copy>
<xsl:apply-templates select="*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:apply-templates select="*"/>
</xsl:template>
Then add matches for what you do want:
<xsl:template match="Foo | Bar">
<xsl:copy-of select="."/>
</xsl:template>
However, it seems like a very unusual requirement. Normally you simply use matches that navigate to the known content through knowledge of the xml.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With