Learn XQuery |
Home:Learn XQuery:XQuery Examples:MySQL Examples:Processing EDI as XML with MySQL and XQuery Processing EDI as XML using MySQL and DataDirect XQuery®In the previous topic, Processing XML using DataDirect XQuery®, you learned how you can merge data available in XML documents and MySQL, and how to format a result consistent with a specific XML Schema. But some of our partner companies don’t use XML at all; they submit book orders in EDI format, specifically using one of the EDI messages part of the EANCOM family. Here's what an incoming order message looks like in EDI:
UNA:+.? ' Of course, we would like to handle EDI as easily as we handled the proprietary XML sent to us by other partners. Luckily enough, DataDirect XQuery® is able to provide access to a wide variety of EDI messages as if they were XML messages, thanks to its integration with DataDirect XML Converters™. Thanks to such integration, EDI messages are just yet another XML format for us to handle. For example, the EDI message above will look like this XML fragment from the DataDirect XQuery point of view:
<EDIFACT> Converting this format in something similar to our canonical XML format is simple using XQuery:
<order> As in the previous example, Processing XML using DataDirect XQuery®, we are still missing information about title, publisher, and publishing date. We can add that information retrieving it from our MySQL database, where the “booksxml” table contains details about our books in inventory:
<order> This XQuery will return a result consistent with the same canonical XML format described in the previous example. As you can see, this single XQuery is able to merge EDI data with information stored in our MySQL database, and format the result to be consistent with a specific XML Schema. The last step we need to accomplish is to archive order information in our MySQL database for reporting purposes. Can we do that using DataDirect XQuery®? Next MySQL Example |
DataDirect XQuery FAQThis informative DataDirect XQuery® FAQ answers frequently-asked questions about DataDirect XQuery® , including questions about performance, scalability, use-cases, resources, and more. If you're more of a hands-on learner, then download a free copy and start exploring DataDirect XQuery® today! New Case StudyGevity produces sales proposals in real time using DataDirect XQuery® . See how Gevity uses DataDirect XQuery® to combine Web service data from SalesForce.com with relational data in Oracle in a pricing engine for HR management. |





