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

[Bug 5083] Namespace declaration attributes in direct element constructors

From: <bugzilla@wiggum.w3.org>
Date: Wed, 26 Sep 2007 20:53:35 +0000
To: public-qt-comments@w3.org
Message-Id: <E1Iadt1-0007DV-HK@wiggum.w3.org>


           Summary: Namespace declaration attributes in direct element
           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

Consider the query

<a xmlns="a-strange-uri{1,2}"/>

I think this is legal, and it places element a in the namespace

Now consider the query

<a xmlns="a-strange-uri{1,-}"/>

I think this is not legal, on the curious grounds that '1,-' is not a valid
XPath expression.

Although the text in says "The value of a namespace declaration
attribute must be a URILiteral;" (where one has to assume that "value" means
the thing after the = sign including the delimiting quotes), the grammar treats
the value as a DirAttributeValue. So we must assume that it must be both a
URILiteral and a DirAttributeValue, and this requires that anything between
curly braces is a valid XPath expression, even though it will never be
evaluated as an XPath expression. This can give rise to some surprising error

To make matters even worse, it seems that the prefix actually being declared is
in-scope within all these spurious XPath expressions, thus:

<a xmlns:b="zzz{a:xyz}" xmlns:a="zzz{b:xyz}"/>

is legal only because the prefixes used within the curly braces are both in

Although it's not nice to change the grammar at this stage of the game, I feel
the only clean solution is to remove the requirement that the value of a
namespace declaration attribute should be a DirAttributeValue. The grammar
would thus become something like:

DirAttributeList ::= (Attribute | Namespace)* 

Attribute ::= S QName S? "=" S? DirAttributeValue /* where QName is suitably
restricted */

Namespace ::= S QName S? "=" S? UriLiteral /* where QName is suitably
restricted */
Received on Wednesday, 26 September 2007 20:53:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:20 UTC