After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 324434 - <xmlns:xmlns/> yields in namespace error
<xmlns:xmlns/> yields in namespace error
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-12-18 23:13 UTC by Björn Höhrmann
Modified: 2021-07-05 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Björn Höhrmann 2005-12-18 23:13:48 UTC
% perl -e "print '<xmlns:xmlns/>'" | xmllint -
1.xml:1: namespace error : Namespace prefix xmlns on xmlns is not defined
<xmlns:xmlns/>
            ^
<?xml version="1.0"?>
<xmlns/>

% xmllint --version
xmllint.exe: using libxml version 20619CVS2407
   compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude
Iconv Unicode Regexps Automata Schemas Modules
Comment 1 Daniel Veillard 2005-12-19 00:00:08 UTC
There is a namespace error, though not about not being defined
  http://www.w3.org/TR/REC-xml-names/#nsc-NSDeclared
  "The prefix xmlns is used only for namespace bindings and is not
   itself bound to any namespace name."

using xmlns for something else than defining a namespace binding is an
error, which should be reported as such, not as being undefined.

Daniel
Comment 2 Björn Höhrmann 2005-12-19 00:17:45 UTC
Well, it's "The prefix xmlns is used only to declare namespace bindings and is by definition bound to the namespace name http://www.w3.org/2000/xmlns/. It must not be declared. No other prefix may be bound to this namespace name."

The relevant text would be "The namespace prefix, unless it is xml or xmlns, must have been declared in a namespace declaration attribute in either the start-tag of the element where the prefix is used or in an an ancestor element".

Your interpretation of "is used" to mean "MUST NOT be used for anything but" isn't really backed up by the Recommendation or related specifications, e.g. createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns') would not raise a NAMESPACE_ERR in DOM implementations and <xmlns:xmlns/> is the only way to serialize that.
Comment 3 Rob Richards 2006-01-05 11:42:34 UTC
This is a grey area. The createElementNS issue was actually brought up on the W3C list years back and a few people said it should raise a NAMESPACE_ERR yet the issue was never addressed. IMO, the interpretation libxml2 uses is correct and the recommendation and specs are just too vauge about it.
Comment 4 Daniel Veillard 2006-01-05 12:51:20 UTC
Yes I still think we should raise a namespace error in such case, just that
maybe it should be a different error message. So I'm not rushing to 'fix' 
that one, there is something to be done, so I'm not closing the bug but I'm not
100% sure how best handle those case.

Daniel
Comment 5 GNOME Infrastructure Team 2021-07-05 13:23:21 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxml2/-/issues/

Thank you for your understanding and your help.