W3C home > Mailing lists > Public > www-ql@w3.org > April to June 2005

Re: Variable references in path expressions

From: TAN Kuan Hui <kuanhui@xemantics.com>
Date: Fri, 29 Apr 2005 10:12:18 +0800
Message-ID: <007a01c54c60$e7a09780$6402a8c0@pinecone>
To: "TAN Kuan Hui" <kuanhui@xemantics.com>, "martin" <martin@x-hive.com>, "Michael Kay" <mhk@mhk.me.uk>
Cc: "'Charles Brooking'" <charles.brooking@research.canon.com.au>, <www-ql@w3.org>

>
> >
> > I might be mistaken, but I think he wants to do this:
> >  > let $a := (<a/>,<b/>,<c/>)
> >  > let $b := (xs:QName("b"), xs:QName("c"))
> >  > return $a/$b
> > .. would lead to $a being filtered by $b's QNames on the child axis, so
> > the result would be <b/>,<c/> (e.g. what you would get by
> > $a/element($b)). I've noticed that some people tend to understand
> > Variable references in XQuery PathSteps this way.
> >
> Following your argument, $b then should simply be treated
> as a sequence of values; applying the element() construct to it does not
> change the sequence of item values into XQuery parsing tokens.
>
> I am not sure this works in the current semantics because path
> expression expects a QName for Name tests not an element
> at the time of parsing.
>
I correct myself. element() triggers KindTest and not element.
element($b) doesn't work in the current syntax it must be
element(QName)
Received on Friday, 29 April 2005 02:12:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:17:17 UTC