I have below XML and want to remove the xml declaration from the payload using XSLT.Please suggest. Input
<?xml version="1.0" encoding="utf-8"?>
<1>
<a>test1</a>
<a>test2</a>
</1>
Output:
<1>
<a>test1</a>
<a>test2</a>
</1>
Use the xsl:output tag
<xsl:output method="xml" omit-xml-declaration="yes" />
With the identity transform
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
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