W3C home > Mailing lists > Public > www-xpath-comments@w3.org > January to March 2002

RE: Comments on XPath 2.0 specification

From: Mike Schilling <mschilling@edgility.com>
Date: Tue, 22 Jan 2002 15:44:52 -0500 (EST)
Message-ID: <3C4DCF98.1020702@edgility.com>
To: www-xpath-comments@w3.org
Michael Kay (<Michael.Kay@softwareag.com> wrote
 > Mike Schilling (mschilling@edgility.com) wrote


> There are many good reasons, I think, for not adopting the "dot product"
> semantics you suggest. One of them is simply that it's incompatible with
> XPath 1.0.


As is the current 2.0 proposal (that this is now an error).  Admittedly, 
that's safer than changing its value without issuing an error.

Still, compare

	sum(//item/quantity * //item/USPrice)

and

	sum(for $item in //item return($item/quantity*$item/USPrice))

(Assuming that's correct.  I'm presuming the bound variable does not 
become the focus of the return expression, since I can't find language 
in the spec saying it does.)

Which is simpler and eaiser to use?

By the way, I presume someone has noticed how much this looks like an 
SQL select, and suggested something akin to

		sum(select quantity*price from //item)


(Here the value of "from" *does* become the focus.)

It still has the disadvantages of keywords and complexity, but at least it's

clearly not procedural.
Received on Tuesday, 22 January 2002 23:21:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:05:54 GMT