Pradeep's Blog

Google

Tuesday, December 12, 2006

Data Mapping Using Xsl

In B2B communications resolution of data between trading partners is one of the most important issue. Let’s consider a scenario where your trading partner sends you a Purchase Order and this PO has got only got a shipping address id. Once you get this PO, you must resolve the shipping address id to an actual destination so that your delivery guys can deliver it. Except the few Big ERP systems most ERP systems do not have to capability to resolve this id to a particular address. Hence the data has to be resolved by a pre-process before the PO enters your ERP System.

Thought there are lots of ways to map information between partners, let me show you how it can be done using an XML mapping file. Let’s also considered that the incoming file is either’s XML or has been transformed to XML. I’ll now show you how an address id can be mapped to the complete address.

Lets consider that the Xml file that we get have the address id as shown


Now instead of the ident field inside the partyaddress something like this would be very useful


In order for us to map the ID to the address we need a mapping file. The actual mapping file could be something like the one shown below; this mapping file will be used in the xsl file to populate the address instead of the address ids.
Now the Xsl part, this is where the actual mapping is done. In the Xsl file create a variable that reads the mapping file like

Now to get the city mapped we could map it as shown above. Here the @id in the mapping file is compared with the ident field in the main xml file. If they are equal then we get the city name from the mapping file.

0 Comments:

Post a Comment

<< Home