[seek-dev] XQuery and XQueryX
Peter McCartney
peter.mccartney at asu.edu
Fri May 16 09:20:37 PDT 2003
well i know Matt loves the power of xml to turn 7 lines into 21 without
saying anything different.
Is this really need to assist machine parsing? look at this website
http://www.w3.org/2002/08/applets/xqueryApplet.htm
which show the resulting tree from the xquery parser available on the same
site. Is xqueryx any easier to process than the output from the parser?
Another way to look at it is which syntax is easier to build up from a user
form interface? Realistically, our search pages are likely to build simple
for expressions and probably no let expressions. The greates complexity will
be in building the where clause for which your website doesn't show an
example of. Im willing to bet, though, that its not unlike the concept
boolean+concept+operator+value syntax we had in Seattle
for $dataset in /eml/dataset
where $dataset/creator/individualName/surname = 'Smith'
return
<EML>
{
$dataset
}
</EML>
Peter McCartney (peter.mccartney at asu.edu)
Center for Environmental-Studies
Arizona State University
-----Original Message-----
From: Dan Higgins [mailto:higgins at nceas.ucsb.edu]
Sent: Thursday, May 15, 2003 6:40 PM
To: seek-dev at ecoinformatics.org
Subject: [seek-dev] XQuery and XQueryX
Hi All,
An interesting introduction to XQuery is on IBMs DeveloperWorks site at
http://www-106.ibm.com/developerworks/xml/library/x-xquery.html
One item that I remembered being discussed in San Diego is whether an XQuery
is just an expression. Apparently an alternate XML syntax called 'XQueryX'
exists for machine parsing. See the example below from the refernced article
Listing 1. A simple query in standard syntax
let $authors := /book/author
return
<AUTHORS>
{
$authors
}
</AUTHORS>
and Listing 2 shows the equivalent in XQueryX:
Listing 2. The same query in XQueryX format
<q:query xmlns:q="http://www.w3.org/2001/06/xqueryx">
<q:flwr>
<q:letAssignment variable="$authors">
<q:step axis="CHILD">
<q:identifier/>
<q:step axis="CHILD">
<q:identifier>book</q:identifier>
<q:identifier>author</q:identifier>
</q:step>
</q:step>
</q:letAssignment>
<q:return>
<q:elementConstructor>
<q:tagName>
<q:identifier>AUTHORS</q:identifier>
</q:tagName>
<q:variable>$authors</q:variable>
</q:elementConstructor>
</q:return>
</q:flwr>
</q:query>
Verbosity won't matter much to the machine that's processing this (unless
we're talking really big queries), but it would be a bit of a struggle for a
human operator doing some actual debugging.
--
*******************************************************************
Dan Higgins higgins at nceas.ucsb.edu
http://www.nceas.ucsb.edu/ Ph: 805-892-2531
National Center for Ecological Analysis and Synthesis (NCEAS)
735 State Street - Room 205
Santa Barbara, CA 93195
*******************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mercury.nceas.ucsb.edu/ecoinformatics/pipermail/seek-dev/attachments/20030516/226054fa/attachment.htm
More information about the Seek-dev
mailing list