- From: TAN Kuan Hui <kuanhui@xemantics.com>
- Date: Fri, 29 Apr 2005 09:53:26 +0800
- To: "Michael Kay" <mhk@mhk.me.uk>, "'martin'" <martin@x-hive.com>
- 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. > > Yes, it's common enough for people to think that a variable holds a fragment > of an XPath expression that's treated as a macro and handled using textual > substitution. You see this a lot with people trying to write <xsl:sort > select="$sortkey"/> in XSLT. They've probably used other languages such as > shell scripts that use $ to introduce a macro variable. > > But I didn't recognize that particular error here! > No, I did not mean return $a/eval($b) Again, it is the way "/" interpretes its rhs operand and not the presence of a sequence being re-interpreted as a set of parsing tokens. " if $a/$b == $b if $a is a singleton " seems to imply, let $a := (5), $b := 1 return $a - $b so $a - $b == $b if $a is a singleton ? Definitely not, because "-" is aware of its operand. I see "/" as a operator in this same context. No ? Unreasonable expectation or intuition ?
Received on Friday, 29 April 2005 01:59:49 UTC