I am new user to XSLT and have been struggling with this problem.
Source XML:
<ABC X="" Y="" Z=""/>
Result XML:
<CDE F="">
<ABC X="" Y="" Z"" G=""/>
</CDE>
Thus I need to
I am able to do these separately but I am not able to do all of these in one XSLT.
Given your assumptions, seems you need one minimal template:
<xsl:template match="ABC">
<CDE F="">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="G">hello</xsl:attribute>
</xsl:copy>
</CDE>
</xsltemplate>
or, if you prefer:
<xsl:template match="/">
<CDE F="">
<xsl:apply-templates select="ABC"/>
</CDE>
</xsl:template>
<xsl:template match="ABC">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="G">hello</xsl:attribute>
</xsl:copy>
</xsl:template>
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