Remove namespaces from child XML element in business ...
xslt - Remove Namespace and add new elements while copying XML - Stack Overflow
How can i remove namespace prefix without removing the xmlns tag?
Removing XML Namespaces
I am using this xslt but it does not remove the prefix after xmlns:
Sample input:
<root> <ns1:AppHdr xmlns:ns1="http://example.com/ns1"> <ns1:sender>Sender1</ns1:sender> <ns1:receiver>Receiver1</ns1:receiver> </ns1:AppHdr> <ns2:Document xmlns:ns2="http://example.com/ns2"> <ns2:title>Document Title</ns2:title> <ns2:author>Author Name</ns2:author> </ns2:Document> </root>
Expected output:
<root> <AppHdr xmlns="http://example.com/ns1"> <sender>Sender1</sender> <receiver>Receiver1</receiver> </AppHdr> <Document xmlns="http://example.com/ns2"> <title>Document Title</title> <author>Author Name</author> </Document> </root>
Output with current xslt:
<root> <AppHdr xmlns:ns1="http://example.com/ns1"> <sender>Sender1</sender> <receiver>Receiver1</receiver> </AppHdr> <Document xmlns:ns2="http://example.com/ns2"> <title>Document Title</title> <author>Author Name</author> </Document> </root>