can't call the outer most return value by name
Jjidanni9 Dec 2011 22:56 # Odd, one can see <R> but not access by it. Run this:
declare function local:K($x){
switch ($x)
case 2 return <R><name>N</name><o><name>Y</name></o></R>
default return()
};
"
A",local:K(2)//*:R,
"
B",local:K(2)/o/name, (: shows we are already at the root :) "
C",local:K(2)/., (: reveals R is really in there, but can't be called by name :) "
D",local:K(2)/./R
What's the deal?
CGChristian Grün9 Dec 2011 23:01 # Hi Jidanni,
<R/> needs to be accessed via the self axis, e.g.:
<R><name>N</name><o><name>Y</name></o></R>/self::R
local:K(2)/R
local:K(2)/child::R
Hope this helps,
Christian
⚡Generated with XQuery