Converting Coded Values

In electronic commerce and EAI applications we frequently need to convert one coded value to another. A common example is when customers order goods using standard UPC codes or their own catalog numbers, and orders that you import into your order management system must use your internal item identifiers. Let's again use Big Daddy's Gourmet Cocoa as an example. The company needs to convert from the UPC numbers its customers are sending to the item identifiers used by the order management system. We'll just use a fragment of the line item as the source tree to demonstrate the conversion. Our basic problem is that we want to convert this:

Source (ItemUPCs.xml)
 <?xml version="1.0" encoding="UTF-8"?> <OrderedItems> <LineItem> ...

Get Using XML with Legacy Business Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.