[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Fwd: War of Attrition (was: Underwhelmed (WAS:

RE:  Fwd: War of Attrition (was:   Underwhelmed (WAS:
At 12:39 PM 9/25/2002 -0500, Bullard, Claude L (Len) wrote:

>I'm curious, Jonathan, because this corresponds to the integration
>thread I was posting to.  What are the cost benefits of X-Query
>over say, SQL?  Is this simply to be able to program to a document
>model API (ie, Infoset-based?)

One of the benefits of XQuery is that it takes XML as input and creates XML 
as output, without requiring the user to work in several different 
languages with several different type systems. Most data is exchanged as 
XML, but stored as relational data, and the tools used to transform between 
the two representations may involve Java, XSLT, SQL, the DOM...and that 
means they are also dealing with distinct type systems.

Another advantage of XQuery is that it is particularly good for views of 
data. An example of this is a query that joins an XML document to an 
SQL/XML view of a relational database. Consider the SOAP primer. For the 
first example, I need to be able to join departurer cities to airports. You 
can do that with an XQuery like this:

let $src := "jdbc:datadirect:sqlserver://localhost:1433;database='airports'"
for $city in input()//p:departing
     let $airports := xq:collection($src)/AIRPORTS/row[CITY = $city]
        if (count($airports) = 0) then <error> No airports found for 
        else if (count($airports) = 1) then <airport>{ 
string-value($airports/CITY) }</airport>
        else if (count($airports) > 1) then
                      for $c in $airports/AIRPORT
                      return (string-value( $c ), " ")
        else ()

The user need not be concerned with the details of how the database is 
represented as XML or the input document is parsed and bound.

This approach is high-level, declarative, and requires very little code.



Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.