Our Scenario
It's always easiest to understand a problem if you can wrap a
real world scenario around it. We describe here the scenario that
we will be using in this tutorial.
Our scenario takes an XML Purchase Order that already exists
on the harddrive (say, previously exported from a backend
database system), applies a Stylesheet to transform it for
preparation to apply an xmlLinguist map to it. The map is
executed, with the resulting 850 file saved back to file.
All of this will be pieced together with a VBScript and
automated via the Windows' Scheduler.
The goal here is to translate an XML Purchase Order into an
EDI 850 Document. While the 850 is a standard document, most XML
Purchase Orders are custom. We've decided to use what we feel to
be a common problem on the web, using a custom XML Document generated
from a PayPal web notification.
When PayPal receives a payment, say from an eBay auction, an HTML
Post can be submitted to a custom website. We create a PHP script
to generate this XML document for our tutorial.
The files needed for this tutorial are listed here:
- PO.xml : the original XML Purchase Order
- POto850.xsl : the stylesheet used to prepare the XML doc for xmlLinguist
- 850.xml : Result of the stylesheet above, for testing purposes only
- 850.ltm : the xmlLinguist map for the X12 850 EDI document
- POto850.vbs : the VBScript that ties everything together
- 850.txt : the final result EDI document outputted from the script.
These files are all in one ZIP file,
xml-to-edi-850.zip. Download the ZIP file and extract them to C:\xml-to-edi-850
since this is where the VB script assumes the files are located.
If they are not put here, then make sure you update your VBScript.
Remember, that in addition to the above files, you need
xmlLinguist
as well as the
xmlLinguist Translation Engine, or LTE for short.
Moving on...
After downloading the above files, you're ready to move on to
Philosophies and assumptions.
|