How to remove namespace?
Hi Experts,
My XSLT is:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="urn:sap-com:document:sap:rfc:functions" xmlns:ns1="http://test.com/XSLT_POC">
<xslutput method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="/ns0:YTEST_SUM.Response">
<ns1:YCUST_OUTPUT><OUT>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>
<xsl:value-of select="SUM"/>
<xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>
<xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
</OUT>
</ns1:YCUST_OUTPUT>
</xsl:template>
</xsl:stylesheet>
My input XML is:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:YTEST_SUM.Response xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
<SUM>12</SUM>
</ns0:YTEST_SUM.Response>
when I use the XSLT for this input XML then the output is:
<?xml version="1.0" encoding="utf-8"?>
<ns1:YCUST_OUTPUT xmlns:ns1="http://test.com/XSLT_POC" xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
<OUT><![CDATA[12]]></OUT>
</ns1:YCUST_OUTPUT>
But I want it like this:
<?xml version="1.0" encoding="utf-8"?>
<ns1:YCUST_OUTPUT xmlns:ns1="http://test.com/XSLT_POC">
<OUT><![CDATA[12]]></OUT>
</ns1:YCUST_OUTPUT>
I don't want both the namespaces in the output root element. I want only ns1.
How can I achieve this? What changes I need to do in my XSLT?
Please help!
Thanks
Gopal
|