Skip to Content
0
Apr 25, 2014 at 02:14 AM

XSLT Mapping for Namespace Prefix replacement

281 Views

Hey All,

I have below XML:

<?xml version="1.0" encoding="UTF-8"?>
<ns0:OrderChange ns0:transactionPurposeIndicator="Change" xmlns:ns0="http://www.api.org/pidXML">
<ns0:OrderChangeProperties>
<ns0:OrderChangeNumber>1</ns0:OrderChangeNumber>
<ns0:OrderChangeDate>2009-10-19</ns0:OrderChangeDate>
</ns0:OrderChangeProperties>
</ns0:OrderChange>

And i need to convert it to below format:

<?xml version="1.0" encoding="UTF-8"?>
<pidx:OrderChange pidx:transactionPurposeIndicator="Change" xmlns:pidx="http://www.api.org/pidXML" xmlns="http://www.api.org/pidXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.api.org/pidXML Z:\integration\trunk\schemas\pidx\OrderChange_1-2.xsd">
<pidx:OrderChangeProperties>
<pidx:OrderChangeNumber>1</pidx:OrderChangeNumber>
<pidx:OrderChangeDate>2009-10-19</pidx:OrderChangeDate>
</pidx:OrderChangeProperties>
</pidx:OrderChange>

Can someone please let me know the XSLT Mapping to achieve this. I have tried searching on the forum but haven't found much help.

Appreciate your help.

Thanks