[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:
Good enough.  It seems to confirm a document model paradigm. Is 
that right?

But that query sure is uglier than SQL.  Maybe it is the beholder thing.

It will be interesting to see how one trains people for developing 
these.  In other words, it took years to get them to accept and 
build tables and reports.  Now it is as if they have to build 
reports (documents) first, and code to the report structures instead 
of the underlying tables.  Somehow that doesn't feel like progress. 
What am I missing?  (yes, I was a technical writer and a document 
wonk for eight years and a markup hypertext designer for the 
next ten; but after doing relational work, that seems long ago).

len

-----Original Message-----
From: Jonathan Robie [mailto:jonathan.robie@d...]



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
return
     let $airports := xq:collection($src)/AIRPORTS/row[CITY = $city]
     return
        if (count($airports) = 0) then <error> No airports found for 
{$city}!</error>
        else if (count($airports) = 1) then <airport>{ 
string-value($airports/CITY) }</airport>
        else if (count($airports) > 1) then
              <airportChoices>
                {
                      for $c in $airports/AIRPORT
                      return (string-value( $c ), " ")
                 }
              </airportChoices>
        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.

Jonathan

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.