DataDirect XQuery to the Rescue

XQuery for Data Integration

Buy Now | Download | Learn More

Applications often need to process information originating from various data sources, including XML documents, relational databases, and various legacy data sources. DataDirect XQuery lets you query XML documents and relational sources, integrating information from multiple data sources in one XML query result.

When you use DataDirect XQuery together with the XML Converters, you can also convert many non-XML formats into XML on the fly, including thousands of versions and sub-versions of EDI messages (EDIFACT, X12, EANCOM, IATA, HL7, and SEF), along with other flat file formats like tab delimited, comma separated value, dBase files, JSON and many more.

Querying XML and Relational Data
DataDirect XQuery is able to handle and join in a single query data sources exposing XML, relational or legacy data formats. The result of an XQuery is generally XML. The following image shows an XML document (<request>…</request>) inquiring about data available in two tables ("holdings" and "historical") in a relational database. The XML document contains information asking for the stock portfolio for a given user within a data range. Using XQuery, it is easy to create even complex nested XML documents by querying XML documents and relational data, as visible on the right side of the image.

XML Relational Integration
Figure 1:Querying Relational and XML Input

Creating XML output is the first step toward publishing XML as HTML, PDF, PostScript, or other formats.

Querying Web Services
Web services return XML, and XQuery is one of the easiest ways to process the result of a web service. And with DataDirect XQuery, you can issue a web service call inside your query with a simple built-in user defined function. The ddtek:wscall() function can call any web service from within an XQuery. For instance, here is a web service call that gets a stock quote from http://swanandmokashi.com using the function ddtek:wscall(). The first argument gives the location of the web service; the second argument contains the payload of the SOAP request.

ddtek:wscall(
<ddtek:location address="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx" 
        soapaction=" http://swanandmokashi.com/GetQuotes"  />
 ,
 <s0:GetQuotes xmlns:s0=" http://swanandmokashi.com" >
 <s0:QuoteTicker>prgs</s0:QuoteTicker>
 </s0:GetQuotes>
)

As the result of the ddtek:wscall() function is just XML, you can use DataDirect XQuery to handle it along with other XML and relational data sources.

Querying EDI and Flat File Formats
Using the DataDirect XML Converters, you can convert many formats to XML on the fly, so they can be queried with DataDirect XQuery. Converters are available for EDI messages (X12, EDIFACT and IATA), along with other binary and flat file formats like tab delimited, comma separated value, dBase files, and many more. Once converted to XML, you can rely on DataDirect XQuery to manipulate the documents and possibly join them with other XML or relational data sources.

Product Information

Quick Links

XQuery for EDI and Flat File Formats

DataDirect XQuery FAQ