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

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4463

           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: 

<quote>
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.
</quote>

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:

<quote>
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.
</quote>

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
http://www.w3.org/2000/xmlns/.

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