Unprefixed name in namespace, issue with default namespace in 12.4 and snapshot 13.0
Hi, BaseX team.
I'm getting unexpected results from the following query:
let $default-namespace as namespace-node() := namespace {""} {"default-namespace-text"}let $e as element() := element {QName('some-ns','abc')} { $default-namespace }
return namespace-uri-for-prefix("", $e)BaseX 12.4 returns 'some-ns' but I expected 'default-namespace-text'.
The BaseX 13.0 snapshot from BaseX130-20261022.200121.exe returns an error: [XQDY0102] Duplicate declaration of namespace ''.
In both cases, it seems like BaseX wants the element being constructed to occupy the default namespace. Maybe that's because the QName(...) expression doesn't provide a prefix to use. It looks like Saxon invents a prefix, and $e comes out as follows:
<_0:abc xmlns="default-namespace-text" xmlns:_0="some-ns"/>This issue seems obscure and is not interfering with my work in a material way.
Thanks, Amanda
…I can only agree; thank you. The issue has been fixed, and a new snapshot is online.
Quoted text · Amanda Galtman · 24 lines
> Hi, BaseX team. > > I'm getting unexpected results from the following query: > > let $default-namespace as namespace-node() := namespace {""} {"default-namespace-text"}let $e as element() := element {QName('some-ns','abc')} { $default-namespace } > return namespace-uri-for-prefix("", $e) > > > BaseX 12.4 returns 'some-ns' but I expected 'default-namespace-text'. > > The BaseX 13.0 snapshot from BaseX130-20261022.200121.exe returns an error: > [XQDY0102] Duplicate declaration of namespace ''. > > In both cases, it seems like BaseX wants the element being constructed to occupy the default namespace. Maybe that's because the QName(...) expression doesn't provide a prefix to use. It looks like Saxon invents a prefix, and $e comes out as follows: > <_0:abc xmlns="default-namespace-text" xmlns:_0="some-ns"/> > > This issue seems obscure and is not interfering with my work in a material way. > > Thanks, > Amanda > > > >
Written for BaseX 12.4. BaseX may have changed since: please check the current documentation.