Skip to Content

Need help in XSLT code to change namespace

Oct 01, 2017 at 12:47 PM


avatar image

Requesting you to help me with the XSLT Mapping code to convert the below source structure namespace(highlighted) with the target structure namespace(highlighted) format

  1. Source Structure Namespace :” xmlns:soapenv=”” xmlns:dssuid=”urn:autoid:specification:universal:Identifier:xml:schema:1″ xmlns:dsscore=”urn:autoid:specification:interchange:PMLCore:xml:schema:1″> <PurchaseQuery> <EventDate>20170926</EventDate> <bizLocation> <id>urn:ddd:id:sgln:0315563.00000.0</id> </bizLocation> <Serialization> <BATCH_ID>3091145AB</BATCH_ID> <EXPIRATION_DATE>20190504</EXPIRATION_DATE> <PRODUCTION_DATE>20170505</PRODUCTION_DATE> <GTIN>04028691544401</GTIN> <Count>8088</Count> </Serialization> </PurchaseQuery> </PurchaseOrderDocument>

Target Structure should be like

<?xml version=”1.0″ encoding=”UTF-8″?> <ns0:PurchaseOrderDocument creationDate=”2017-09-26T18:37:48.837Z” xmlns:ns0=”urn:global:mns:PurchaseOrder”> <PurchaseQuery> <EventDate>20170926</EventDate> <bizLocation> <id>urn:ddd:id:sgln:0315563.00000.0</id> </bizLocation> <Serialization> <BATCH_ID>3091145AB</BATCH_ID> <EXPIRATION_DATE>20190504</EXPIRATION_DATE> <PRODUCTION_DATE>20170505</PRODUCTION_DATE> <GTIN>04028691544401</GTIN> <Count>8088</Count> </Serialization> </PurchaseQuery> </ns0:PurchaseOrderDocument>

The rootnode contains creationdate which will get value from source structure. Iam facing difficulty as the rootnode has this field.

Kindly help me with your solutions

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Peter Wallner Oct 03, 2017 at 03:28 PM

Hello PI User,

Please check this blog - it should help you solve your issue:

Best regards, Peter

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hello Peter,

Thanks for your suggestion. The issue is resolved after doing modifications to the XSLT code.