I need to disable output escaping and remove occurrence of XML definition i.e xml version="1.0" encoding="UTF-8"?>
Input Data:
<ns1:outSystemWSResponse xmlns:ns1='http://abcd.co.za'
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<ns1:out><?xml version="1.0" encoding = "UTF-8"?><PQR>
<STU>
<TEST1>Pen</TEST1>
<TEST2>Table</TEST2>
</STU>
</PQR></ns1:out>
</ns1:outSystemWSResponse>
Expected Output
<?xml version="1.0" encoding="UTF-8"?>
<ns1:outSystemWSResponse xmlns:ns1="http://abcd.co.za"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns1:out>
<PQR>
<STU>
<TEST1>Pen</TEST1>
<TEST2>Table</TEST2>
</STU>
</PQR>
</ns1:out>
</ns1:outSystemWSResponse>
I tried with below XSLT but i am not sure how I can remove, xml version="1.0" encoding="UTF-8"?>. Please help
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ns:out" xmlns:ns="http://abcd.co.za">
<xsl:copy>
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>