YOUR FEEDBACK
Werner Keil wrote: Java 6 update 10. If I'd be running Apple, I'd probably really drop dead...
AJAXWorld RIA Conference
$300 Savings Expire September 12th. Register Today and SAVE!


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
TODAY'S TOP SOA & WEBSERVICES LINKS


EDI to XML: A Practical Approach
Accessing or creating EDI messages as XML

A Practical Approach
That all sounds very interesting, but in practical terms how can that work? Are there ways to make XSLT or XQuery processors deal with EDI as if it was XML?

One simple yet powerful way to make most existing XQuery and XSLT engines able to process EDI as XML is to make the processor able to access non-XML data through custom URI resolvers. What is a URI resolver? When an application tries to access a resource referenced as, for example, file:///c:/myFolder/myDocument.xml or http://myServer/myFolder/myDocument.xml, what happens under the cover is that the standard URI resolver understands that “file:” identifies a resource on your local file system and retrieves the file myDocument.xml in the myFolder directory, or “http:” identifies a request to access a resource through the HTTP protocol and it connects to myServer to GET myfolder/myDocument.xml.

That mechanism is extensible. You can, for example, create and use a custom URI resolver that knows how to deal with a specific URI scheme. For example, if your application references a URI, such as converter:EDI?file:///c:/myMessage.edi, the custom URI resolver will know that what the application is requesting is to retrieve an XML interpretation of the EDI message myMessage.edi.

That’s quite a powerful mechanism; applications can leverage it to do what we described above: give XQuery or XSLT processors the ability to handle both XML and non-XML data transparently as if everything was in fact XML.

For example, an XQuery could be in charge of retrieving all the book orders received as part of an incoming EDI message from a business partner and return them in an XML format required by your application. Assume the EDI incoming message looks like Listing 1 and that the XQuery processing the EDI message looks like Listing 2. The result of such XQuery would be something like Listing 3.

As you can see, the XQuery doesn’t know about the fact that you’re querying an EDI message to generate XML. From the XQuery point of view, you’re dealing strictly with XML.

A similar extension can apply on the output side. Suppose I want to answer my business partner using an EDI message (since that’s all that partner can process); of course I’d like to be able to just deal with the generation of the proper response in XML terms, and then assume that what the business partner gets is actually EDI.

You can do that, for example, by extending the concept of output method. Both XQuery and XSLT already support the ability to instruct the processor to serialize the result of their processing not only as XML, but also as HTML, XHTML, or event text. What if you were able to tell your XQuery processor: “serialize the result as EDI?” Your application would be able to focus on the fact that it’s dealing with querying and creating XML, but its result would in fact be EDI.

For example, the XQuery in Listing 4 (where only a portion is displayed) would generate an EDI message as the result as shown in Listing 5.

Conclusion
Even if XML is becoming more and more widespread, modern B2B applications still need to deal with a variety of formats for incoming and outgoing messages. EDI is still widely used, especially in some specific market verticals, and it seems unlikely that its use will vanish any time soon. Being able to have infrastructures that can deal with heterogeneous data formats without forcing IT organizations to worry about what such data formats are and how to deal with them is crucial. Languages like XQuery and XSLT that are meant to work against the XML Data Model provide a great way for abstracting the physical details of the data that has to be manipulated or created and focus only on handling XML data. That approach allows EDI, text, or binary formats to be queried or even generated as if they were plain XML. There are already XQuery implementations on the market that expose such functionality and that even extend that approach to the relational world, making it possible to deal with relational data, XML, and non-XML documents as if they were all expressed as an XML Data Model.

About Carlo Innocenti
Dr. Carlo Innocenti is senior XML program manager at DataDirect Technologies (www.datadirect.com), responsible for the overall strategy and direction of the XML products group including DataDirect XQuery (www.xquery.com), DataDirect XML Converters (www.xmlconverters.com) and Stylus Studio.

XML JOURNAL LATEST STORIES . . .
To be able to do anything useful, an ESB must be configured with all sorts of parameters, from endpoint connection URIs to message transformation scripts to content-based routing definitions. Moreover, ESBs like Mule can host custom components, which will process messages and perform u...
Representatives of the state IT organizations of Brazil, South Africa and Venezuela, three of the four countries that protested ISO’s standardization of Microsoft’s Office Open XML (OOXML) file format, have apparently thrown in the towel on taking their appeal any further. India, t...
Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted to be...
Red Hat CTO Brian Stevens, Citrix CTO Simon Crosby, Egenera CTO Pete Manca, Allen Stewart, Group Manager, Windows Virtualization at Microsoft, and Brian Duckering, Sr. Director of Products and Alliances at Symantec were the top industry executives who joined Jeremy Geelan in the 4th Fl...
This article is aimed at beginner and intermediate Web developers looking to make the leap into database support of their Web site. The article suggests a new declarative language based on HTML-forms, which is used for development of the database interface. HTML forms can manage not on...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON FEATURED WHITEPAPERS


ADS BY GOOGLE
BREAKING XML NEWS

Security Challenges for the Information Society