Namespace scoping in direct element constructor
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
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 On Thu, May 26, 2016 at 11:49 AM, Gunther Rademacher <grd@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
participants (2)
-
Christian Grün -
Gunther Rademacher