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?
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
The following query..
local:K(2)/R
..is a shortcut for
local:K(2)/child::R
Hope this helps, Christian
basex-talk@mailman.uni-konstanz.de