05-06-2015 6:14 AM
Hi,
I am trying to perform what I have read is the simplest XSLT task possible.
The task is to copy all XML to an output document while suppressing certain tags under certain conditions.
What I have noticed is that the attributes of my nodes are being lost.
For example, within my XML output I have a tag <InstdAmt Ccy='EUR'>1000</InstdAmt>.
Once the template below has been applied all tags are copied but the "Ccy" attribute is lost.
Could anyone provide some insight into what I am doing wrong...
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0">
<xsl:output omit-xml-declaration="no" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
05-10-2015 6:55 PM
Have found the solution to this.
The issue lies in the difference between deep and shallow copy in XSLT.
Have begun using deep copy and am getting desired results.
05-10-2015 6:55 PM
Have found the solution to this.
The issue lies in the difference between deep and shallow copy in XSLT.
Have begun using deep copy and am getting desired results.