[Bug 3606] [XPath] delimiting tokens

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

           Summary: [XPath] delimiting tokens
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


For unrelated reasons, I was looking at test LocalNameFromQNameFunc018, which
contains the line:

declare default element namespace"http://www.example.com/QNameXSD";

This test is intended to succeed, and Saxon parses it successfully; but looking
at the spec, it seems this isn't allowed. 

A2.2 (in XQuery) says: 

(a) The non-delimiting terminal symbols are: ... namespace, ... StringLiteral,
... 

(b) It is customary to separate consecutive terminal symbols by whitespace and
Comments, but this is required only when otherwise two non-delimiting symbols
would be adjacent to each other.

Is there any good reason why StringLiteral is classified as a non-delimiting
symbol?

Am I correct in saying that as the spec stands, the above line should be a
syntax error?

There are other oddities in the list of non-delimiting symbols as well. For
example, it includes Char. This suggests that in the production rule

[159]           CommentContents            ::=          (Char+ - (Char* ('(:' |
':)') Char*))

the Char tokens must be separated by whitespace, whereas of course the opposite
is true. I think that symbols that are used only in ws:explicit rules have no
place in this list.

Also, the statement "There are two exceptions to this, that of "." and "-",
which do require a symbol separator if they follow a QName or NCName" isn't
quite complete: "." also requires a separator if it precedes or follows a
numeric literal.

I encountered this in XQuery, but it applies in principle to XPath also.

Received on Thursday, 17 August 2006 09:13:07 UTC