OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: XQuery -- Reinventing the Wheel?



Jonathan Robie wrote:
> XQuery's FLWR expressions are quite similar to SQL's 
> SELECT/FROM/WHERE. It may make sense, incidentally, to 
> add these to XSLT as well.

What exactly do you mean by this? If you mean giving XSLT an alternative
syntax, fair enough. But if you're supposing that such an addition would
add any functionality, you would be wrong. FLWR expressions have a very
straightforward mapping to existing XSLT constructs, namely for-each,
variable, if, and general result construction via copy-of, literal result
elements, etc. (BTW, the XML syntax I facitiously suggested earlier *is*
XSLT, though no one acknowledged this.)

> To a database person, it is somewhat surprising that your 
> paper does not explicitly mention joins, which are one of 
> the biggest reasons for FLWR expressions in XQuery. Joins 
> are central to database functionality, and it is important 
> to express them in a way that allows optimization based on 
> patterns detected in the expressions. I also notice that the 
> examples in your paper do not include any examples from 
> Section 3 of the XQuery paper, which shows how conventional 
> SQL-like queries are done.

That's because Section 3 does not introduce any new query functionality.
Using joins over an XML view of a relational database is just another use
of the FLWR expression. The XSLT mappings to these are just as determinate
as the rest.

> In your paper, you point out that FLWR expressions do have 
> some syntactic similarity to XSLT's <xsl:foreach />. This is 
> true, but it misses the purpose of FLWR expressions, which is 
> to provide general SQL-like functionality for joins and 
> declarative restructuring.  A naive mapping of FLWR expressions 
> to <xsl:foreach /> is not likely to give you an efficient 
> implementation of joins.

If all you gleaned from my paper was an identification of syntactic
similarity, then either you need to re-read it or I need to rewrite it. (I
probably need to rewrite it.) The mapping you perceive as "naive" is, on
the contrary, determinate and equivalent. It is irrational to say that one
will produce more efficient implementations than the other.

The processing models of FLWR expressions and that subset of XSLT I'm
calling "down-reference pull" are basically the same, but the semantics
are slightly different.

Instead of continuing to harp on this, I will submit an explanation of the
key semantic similarities and differences between XSLT down-reference pull
and FLWR expressions. Hopefully, the XML Query Working Group is already
internally addressing these issues, or could benefit from my addressing
them here.

Evan Lenz
XYZFind Corp.