Namespace scoping in direct element constructor

Thursday, 26 May 2016 · 2 messages
GR
Gunther Rademacher26 May 2016 11:49 #

The order of attributes, including namespace declaration attributes, in a direct element constructor is not significant. But while playing around I found that it makes a difference with BaseX for expressions that are embedded in an attribute.

So these two constructors produce different results, but I think it should be the same:

     basex -q"<e xmlns='A'><e xmlns='B' a='{namespace-uri-for-prefix((),
<e/>)}'/></e>"

basex -q"<e xmlns='A'><e a='{namespace-uri-for-prefix((), <e/>)}' xmlns='B'/></e>"

Tested on BaseX 8.4.1.

Best regards Gunther

CG
Christian Grün26 May 2016 17:42 #

Hi Gunther,

Yes, this is a known issue in BaseX. Here is another example for two queries that should yield the same result (currently, the first one fails):

  <e a="{1 instance of integer}" xmlns="http://www.w3.org/2001/XMLSchema"/>

  <e xmlns="http://www.w3.org/2001/XMLSchema" a="{1 instance of integer}"/>

Thanks for reporting it; it’s just another hint that we should get this fixed.

All the best, Christian

Quoted text · Gunther Rademacher · 19 lines
On Thu, May 26, 2016 at 11:49 AM, Gunther Rademacher <grd at gmx.net> wrote: > The order of attributes, including namespace declaration attributes, in a > direct element constructor is not significant. But while playing around I > found that it makes a difference with BaseX for expressions that are > embedded in an attribute. > > So these two constructors produce different results, but I think it should > be the same: > > basex -q"<e xmlns='A'><e xmlns='B' a='{namespace-uri-for-prefix((), > <e/>)}'/></e>" > > basex -q"<e xmlns='A'><e a='{namespace-uri-for-prefix((), <e/>)}' > xmlns='B'/></e>" > > Tested on BaseX 8.4.1. > > Best regards > Gunther

⚡Generated with XQuery