This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3606 - [XPath] delimiting tokens
Summary: [XPath] delimiting tokens
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 2.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3765
  Show dependency treegraph
 
Reported: 2006-08-17 09:12 UTC by Michael Kay
Modified: 2007-02-25 23:47 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2006-08-17 09:12:55 UTC
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.
Comment 1 Scott Boag 2006-08-25 15:38:02 UTC
> Is there any good reason why StringLiteral is classified as a non-delimiting
> symbol?

Not that I can see. In fact, I think it's contradicts """ and "'" being delimiting characters.  So, yes, I think this is a bug and should be fixed.

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

I would let it pass, given my statement above that there is a contradiction.

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

I agree.

>> "." also requires a separator if it precedes or follows a
>> numeric literal.

I agree.
Comment 2 Scott Boag 2006-08-25 18:49:37 UTC
Resolution accepted by WG.
Comment 3 Jim Melton 2007-02-25 23:47:01 UTC
Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.