Namespaces on element construction
Friday, 11 January 2013 · 3 messages · last reply 14 May 2013
AV
Arto Viitanen11 Jan 2013 14:54 #
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
CG
Christian Grün14 Jan 2013 12:59 #
Dear Arto,
thanks for reporting this; looks like a bug, which I’ve added to our issue tracker:
https://github.com/BaseXdb/basex/issues/618
Best,
Christian
Quoted text · Arto Viitanen · 45 lines
On Fri, Jan 11, 2013 at 2:54 PM, Arto Viitanen <arto.viitanen at microteam.fi> wrote: > 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 > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
CG
Christian Grün14 May 2013 23:02 #
Hi Arto,
it has been quite a while when you had stumbled upon an issue with the XQuery 3.0 namespace constructor. More specifically, it was unclear back then what happens if a dynamic default namespace is specified in an element constructor. I just wanted to let you know that we can’t offer a fix for this yet, but the issue will soon be discussed in the W3 working group [1] and may lead to an update of the XQuery specification.
More soon,
Christian
[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=22032
Quoted text · Christian Grün · 58 lines
On Mon, Jan 14, 2013 at 12:59 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Dear Arto, > > thanks for reporting this; looks like a bug, which I’ve added to our > issue tracker: > > https://github.com/BaseXdb/basex/issues/618 > > Best, > Christian > ___________________________ > > On Fri, Jan 11, 2013 at 2:54 PM, Arto Viitanen > <arto.viitanen at microteam.fi> wrote: >> 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 >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>
Written for BaseX 7.5, 7.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery