XML query language

Paul Prescod paul at prescod.net
Tue Mar 30 21:03:01 BST 1999


Oren Ben-Kiki wrote:
> 
> I don't follow. You yourself have said:
> 
> >The IDL for an XML QL should be something like:
> >
> >NodeList XMLQuery( DOC doc, String query )
> 
> Well, them, what other way is to return a list of XPointers then to store
> each in an "element"? 

You don't need an element. You just need a nodelist. Look at the DOM's
brutally named "getElementsByTagName" method. 

Also consider the XSL specification:

> A select pattern must match the production for SelectExpr; it returns 
> the list of nodes that results from evaluating the SelectExpr with the 
> current node as context; the nodes are in the list are in document order.

XPointer is interesting because it doesn't support either interpretation:
"The result of a spanning selection cannot generally be expressed as a
well-formed XML document, nor as a node or list of nodes from an element
tree."

--

If you are asking me what is the syntax for a nodelist then I'll say it
has no syntax. It is an abstraction like the record set returned by a
database. If you have to move the query result between machines then you
can choose an encoding (quite likely XML) but that's outside of the realm
of the query language itself -- it is akin to report writing. 

If you aren't moving data between processes then you shouldn't be forced
to encode it in XML (even a DOM). This is just a general principle that
applies here.

> This is assuming that you prefer the query engine to
> return a list of pointers as a result, which I don't. The one nice thing
> about this scheme is that you can add extra data per XPointer - a relevancy
> score, for example.

I'm not convinced that this is the domain of the query language, but even
if it is then you are asking for an annotated nodelist, not a DOM. If we
do decide to go ahead with annotated nodelists then we would have to add
that to the XML data model.

That still doesn't have anything to do with generating XML elements:
*unless the application wants to do so*.

> I stand corrected. I think you've phrased it perfectly above - the output
> should be defined in the terms of the XML data model.

And that model has a concept of nodelist -- this is the most appropriate
return value for query results.
-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

"Perpetually obsolescing and thus losing all data and programs every 10
years (the current pattern) is no way to run an information economy or
a civilization." - Stewart Brand, founder of the Whole Earth Catalog
http://www.wired.com/news/news/culture/story/10124.html

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list