W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2002

RE: variable binding in XPath was: Comments on XPath (30th April)

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Wed, 22 May 2002 20:18:00 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E6210602679DF0@daemsg02.software-ag.de>
To: Evan Lenz <evan@evanlenz.net>, "Kay, Michael" <Michael.Kay@softwareag.com>
Cc: David Carlisle <davidc@nag.co.uk>, public-qt-comments@w3.org
> If we remove the "full" for from XPath, then I agree that let 
> would be 
> needed. I don't want to give up the ability to access 
> intermediate context 
> nodes (as opposed to being restricted to the ends of the 
> spectrum, i.e. . 
> and current()).

Yes. The strongest use case for adding LET is that it would allow you to
bind to the context node at each level of predicate nesting:

   chapter[let $c := @id return section [starts-with(@id,$c)]]

I don't like the syntax: it would be much nicer to write

   chapter[$c; section [starts-with(@id,$c/@id)]]

but at least it gives the functionality.

Michael Kay
Received on Wednesday, 22 May 2002 14:18:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:56:42 UTC