Why does this query (on BaseX 7.5, basexgui)
let $ns := namespace {''} {'the-namespace'}
let $c1 := <c xmlns="the-namespace">text</c>
let $c2 := <c>{ $ns,'text'}</c>
let $c3 := element {'c'} {$ns,'text'}
let $qn := QName($ns, 'c')
let $c4 := element {$qn} {'text'}
let $nl := " "
return ($c1,$nl,
$c2,$nl,
$c3,$nl,
$c4,$nl,
'|' || namespace-uri-from-QName(node-name($c1)) || '|',$nl,
'|' || namespace-uri-from-QName(node-name($c2)) || '|',$nl,
'|' || namespace-uri-from-QName(node-name($c3)) || '|',$nl,
'|' || namespace-uri-from-QName(node-name($c4)) || '|',$nl)
outputs
<c xmlns="the-namespace">text</c>
<c xmlns="the-namespace">text</c>
<c xmlns="the-namespace">text</c>
<c xmlns="the-namespace">text</c>
|the-namespace|
||
||
|the-namespace|
I.e, the namespace seems to exist on all four cases when outputted, by
node-name finds it only if the namespace is given in element as text,
or as QName value in computed element.
--
Arto Viitanen
Microteam Oy
Finland