Skip to Content
0
Jul 04, 2012 at 04:42 PM

Removing namespace prefix using xslt mapping

3161 Views

hi

I am working on a SOAP to proxy sync scenario and want to remove the namespace prefix in the response mapping as the sender system cannot accept namespace prefixes...

XMLanonymizer bean does not work in the sender soap adapter

Can anyone help with the XSLT code for removing the namespace prefix

Requirement –

Remove all namespace prefixes in the input xml ( it can be ns0 / ns1 etc )

Sample input –

<?xml version="1.0" encoding="UTF-8" ?>
<ns0:ORDERRESPONSE xmlns:ns0="http://www.opentrans.org/XMLSchema/1.0" version="1.0">
<ns0:ORDERRESPONSE_HEADER>
<ns0:ORDERRESPONSE_INFO>
<ns0:ORDER_ID>xxxxx</ns0:ORDER_ID>

Sample output –

<?xml version="1.0" encoding="UTF-8" ?>

<ORDERRESPONSE xmlns ="http://www.opentrans.org/XMLSchema/1.0" >

<ORDERRESPONSE_HEADER>

<ORDERRESPONSE_INFO>

<ORDER_ID>xxxxx<ORDER_ID>