RE: [xml-dev] XPath 2.0 - how much of XQuery should it include? [fwd]

> From: Michael Fuller [mailto:msf@mds.rmit.edu.au] 
> 
> > [In XSLT+XPath 2.0] There are roughly the same features in 
> both: XSLT 
> > uses xsl:for-each, XPath uses for; XSLT uses xsl:choose, XPath uses 
> > if; XSLT uses xsl:sort, XPath uses sort-by();

XSLT/XPath is a two-language system. It's closely analogous to using, say
JSP+SQL. Each of the two languages fulfils a particular purpose: XSLT
defines elements to be written to the result document, XPath defines
information to be fetched from the source document.

In a two language system it is never possible to achieve complete
compositionality (the ability to use any expression in a place where a value
is required). In particular, one can't use XSLT expressions inside XPath. To
compensate for this lack of compositionality, it's inevitable that some of
the basic scaffolding that any language needs (control structures,
conditionals, function calling) will be duplicated between the two
languages. Otherwise, the amount of switching beween the two languages would
become unbearable.

It's my belief that in a two-language system it will never be possible to
draw a completely satisfactory boundary between the two, or to avoid some
duplication, but I haven't seen any proposal that's obviously an improvement
on the split that we have adopted. 

> 
>     In particular, XPath 2.0/XSLT 2.0 should be fixing known 
> problems and
>     omissions in the 1.0 versions, without blowing out excessively.
>     XPath is there to provide core functionality; other standards can
>     extend on that, as required.
> 
It's probably possible to divide the enhancements in XSLT 2.0/XPath 2.0 into
two categories: the "functionality" enhancements, which are all there in
direct response to user experience with XSLT 1.0/XPath 1.0, and the "data
model" enhancements, which are there to increase the power of the language
and the range of problems it can be applied to. As XML becomes a key
component of large-scale distributed information systems, the WGs feel that
key components such as XSLT and XPath need to be underpinned by a more
rigorous and robust type system. It's quite true that few existing users
have been asking for this; it's also true that most existing users have been
using XSLT and XPath in a very limited domain of application, namely for
rendition of XML into HTML and other presentation formats. We want the two
languages to be capable of more than that.

Michael Kay

Received on Thursday, 16 May 2002 01:56:34 UTC