W3C home > Mailing lists > Public > public-qt-comments@w3.org > April 2007

[Bug 4463] [XQuery] Missing rules for misuse of the xmlns namespace

From: <bugzilla@wiggum.w3.org>
Date: Thu, 12 Apr 2007 23:06:37 +0000
To: public-qt-comments@w3.org
Message-Id: <E1Hc8NB-0007Lb-42@wiggum.w3.org>


           Summary: [XQuery] Missing rules for misuse of the xmlns namespace
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org

There seem to be some extra rules needed to prevent abuse of the name "xmlns"
and the associated URI "http://www.w3.org/2000/xmlns/".

XML Namespaces 1.1 states: 

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 or undeclared. Other prefixes MUST NOT be bound to this
namespace name, and it MUST NOT be declared as the default namespace. Element
names MUST NOT have the prefix xmlns.

There seems to be no corresponding rule in XQuery for namespace declarations in
the prolog. For namespace declarations appearing in direct element constructors
we have half of the rule, namely the ban on binding the prefix xmlns, but there
is no ban on binding a prefix to the URI http://www.w3.org/2000/xmlns/

There is a rule against use of this namespace in a constructed attribute, but
it is badly worded:

The node-name property of the constructed attribute (an expanded QName) is
checked as follows: If its URI part is http://www.w3.org/2000/xmlns/
(corresponding to namespace prefix xmlns) or if it is in no namespace and its
local name is xmlns, a dynamic error [err:XQDY0044] is raised.

This hints that the error only arises if (a) the prefix is xmlns, *and* (b) the
URI is http://www.w3.org/2000/xmlns/, whereas it should arise if *either* of
these conditions is true.

There is also no corresponding rule for computed element constructors. XML
Namespaces 1.1 says "Element names MUST NOT have the prefix xmlns", and the
earlier rule also implies that they must not have the URI

It might also be useful to state some of these rules as constraints in XDM.
Received on Thursday, 12 April 2007 23:06:38 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:33 UTC