Re: Variable references in path expressions

>
> >
> > 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