XML query languages and their encodings

Paul Prescod paul at prescod.net
Sat Apr 3 06:23:05 BST 1999


Marcelo Cantos wrote:
> 
> In our own internal discussions on query models, the issue of
> determining context has always had an impact on the conceptual model.
> There are essentially two camps:
>   1. return just the node (or subtree).

By this I think that you mean a *copy of the node*.

>   2. return a "pointer" to the node.
>
> Returning a pointer allows one to go back to the original document and
> traverse up, down, back and forth at will.  It is the most powerful
> mechanism.  On the other hand, it also involves a considerable amount
> of network traffic as the user traverses a DOM-style tree across the
> client-server connection.

I didn't claim that it was appropriate for the user to traverse a
DOM-style tree across the connection. IMO, what happens after the node is
found is not the concern of the query language. If the server returns a
copy of the node: great! If the server returns a pointer to the node:
great! If we want to invent formal languages for expressing which the
client needs and for encoding either pointers or copies, that's great too.
But all the query language should care about is pointers to nodes.

> This would then return the nodes of a query and the related TOC's.
> The essence of this approach is that you get back only as much context
> as you want.  You also have the power to express whatever level or
> complexity of context you want (it also means the server can do the
> work without hops).  Then again, if you are not interested in context,
> you don't wear the cost of having it.

That's all fine for defining the context of queries. But you haven't
addressed deletions, moves and arbitrary function application. Your query
language is also not enough to support XSL. In XSL the result of one query
is often used as the context of another.

In my mind this is evidence that enforcing (as opposed to allowing)
context-losing node copying is a dead end.

> The point to be made from all this is that your query model will be
> greatly affected by delivery considerations.  It is not necessarily a
> case of getting the model right and then worrying about how to return
> results in a practical setting.

You haven't said anything yet to make me think that a pointer-based
approach is impractical. If a user wants a partial-context copy of data
then XTL is the perfect, standardized language for making a copy of the
data. If they need a pointer with full context (i.e. if they are
*implementing XTL*) then you should be able to provide it.

 Paul Prescod

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