Application 4: Supply Chain Band Aid
One of the costliest areas in a supply chain application is integration. This typically takes the form of incompatible message formats. The buyer has decided to move to something more standard, like RosettaNet, and away from its previous in-house created format. As a supplier, you agree in principal with open standards, but you weren't quite ready to move just yet. The move to RosettaNet is really going to throw a wrench in the works.
What you need is a band-aid, something to get you by until you have time to move your whole application to the new standard. Essentially what you are looking for is a way to map, or transform your existing format to the RosettaNet format, but you don't want to write a bunch of code. Instead, you want to control exactly how the components of the input document get mapped to the schema your application already accepts.
Here's a query that demonstrates how to transform a document snippet into a format suitable for the local application. The customer's RosettaNet format uses an XML vocabulary that represents a sample purchase order and line items, such as:
Your application expects line items represented in the following format:
<po:LineItem itemId="pxz100121" qty="12"
You need a query that can transform the incoming RosettaNet document into your custom format. Here's a query that achieves the transformation.
declare namespace ord="http://www.customer.com/orders"
declare namespace po="http://www.myapp.com/po"
for $custlineitem in