[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XQuery -- Reinventing the Wheel?

  • From: Evan Lenz <elenz@x...>
  • To: Michael Rys <mrys@m...>
  • Date: Fri, 23 Feb 2001 22:50:53 -0800

chaining xslt
Michael Rys wrote:
> Now I do not disagree that there is a subset of XSLT that should have the
> same semantics as XQuery, but I consider defining a subset of XSLT instead
> of XQuery to be a very dangerous proposition. Once you start subsetting an
> existing language that way, you may lose composability (how do
> you make XSLT
> composable without the template-rule? Chaining XSLT-files? Give me a
> break...) and end up with a very messy syntax. And this assumes that you
> "fix" some of the current messy semantics of XPath.

I don't follow your link between composability and template rules...

Regarding composability, it's true that this is currently a semantic
difference between XSLT and XQuery. However, XSLT 1.1 will already be
changing this. By implicitly accessing result tree fragments as node-sets,
XSLT 1.1 provides a similar "subquery" mechanism as used in the expression
below (from the XML Query Algebra):

for b in (for a in bib1 do a/book) do b/author
= for a in bib1 do (for b in a/book do b/author)

The equivalent XSLT 1.0 formulation of the right-hand side of this equation
is trivial:

<xsl:for-each select="$bib1">
  <xsl:for-each select="book">
    <xsl:copy-of select="author"/>
  </xsl:for-each>
</xsl:for-each>

The left-hand side currently cannot be expressed by XSLT (without an
extension function). However, with the move toward composability effected by
the access to arbitrarily constructed trees as node-sets, XSLT 1.1, to say
nothing of XSLT 2.0, will be able to express this as follows:

<xsl:variable name="temp">
  <xsl:for-each select="$bib1">
    <xsl:copy-of select="book"/>
  </xsl:for-each>
</xsl:variable>

<xsl:for-each select="$temp/node()">
  <xsl:copy-of select="author"/>
</xsl:for-each>


My intention here is to identify converging semantics, not syntax. What I'm
wondering is why the models do not converge, when the gap between them seems
to be narrowing further and further (per the XPath 2.0 and XSLT 2.0
requirements docs, especially wrt typing). Maybe the gap *will* close; I
just don't get the impression that that is a goal of the Query WG. XML Query
and XSLT seem to have the same requirements in this area (or at least
proposed requirements). My question is: if the requirements do not differ,
why should the standards differ (apart from having multiple syntaxes)?

Evan Lenz
XYZFind Corp.


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.