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 29700 - [XP31] ws:explicit wording on comments is a tad unfortunate
Summary: [XP31] ws:explicit wording on comments is a tad unfortunate
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 minor
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-21 11:33 UTC by Abel Braaksma
Modified: 2016-07-20 14:02 UTC (History)
2 users (show)

See Also:


Attachments

Description Abel Braaksma 2016-06-21 11:33:09 UTC
The current test on ws:explicit in production rules states:

<quote>

ws: explicit

   /* ws: explicit */ means that the EBNF notation explicitly notates, with S 
   or otherwise, where whitespace characters are allowed. In productions with the
   /* ws: explicit */ annotation, A.2.4.1 Default Whitespace Handling does not 
   apply. Comments are also not allowed in these productions.
</quote>

The word "Comments" is underlined and points to the production rule for comments. This suggests that for instance the following is disallowed:

Q{http://(:comment:)/test}

But I think that's not true, in fact, I think the above EQName is valid and the whole string including the comment is part of it. That is, the URI is equal to "http://(:comment:)/test", not "http:///test", and it should not throw a syntax error. 

Essentially, such comment is not a comment. Perhaps a better wording would be to say:

<proposal>
   Comments are not recognized as comments in these productions and the
   characters "(", ":" and ")" may or may not be allowed by the production rule.
</proposal>
Comment 1 Michael Dyck 2016-06-21 14:19:16 UTC
(In reply to Abel Braaksma from comment #0)
> 
> Essentially, such comment is not a comment.

Right. More precisely, that sequence of characters is not a Comment. So it is unaffected by rules about Comments. 

> Perhaps a better wording would be to say:
> 
> <proposal>
>    Comments are not recognized as comments in these productions

I don't think that's an improvement, as it implies that something can be a comment and yet not be 'recognized as' a comment.

I agree that the 'ws: explicit' blurb could probably be improved, but I don't think that's how to do it.

(Personally, I'd be okay with removing the sentence "Comments are also not allowed in these productions", since I believe that's covered by "A.2.4.1 does not apply", but we probably added it for a reason. I'll look into that.)
Comment 2 Michael Dyck 2016-06-21 14:58:24 UTC
(In reply to Michael Dyck from comment #1)
>
> (Personally, I'd be okay with removing the sentence "Comments are also not
> allowed in these productions", since I believe that's covered by "A.2.4.1
> does not apply", but we probably added it for a reason. I'll look into that.)

The sentence was added to the XQuery 1.0 source on 2004-06-07, but the commit log doesn't say why (or give a reference to a decision or discussion). So far, I haven't been able to find any discussion in the archives.
Comment 3 Abel Braaksma 2016-06-21 15:05:32 UTC
>  but we probably added it for a reason. I'll look into that.
You may have to dig deep, the sentence was there when this section was first added in 2004, this is the first time I encountered it: https://www.w3.org/TR/2004/WD-xpath20-20040723/#ExplicitWhitespaceHandling

I'd have to guess, but since comments are typically allowed where ignorable whitespace is allowed, this sentence may have been added with an intended meaning such as:

"Comments are allowed between terminals, but not between terminals or anywhere within productions marked ws:explicit. Typically, comments are allowed where whitespace is allowed, but not were we use the explicit production S.".
Comment 4 Abel Braaksma 2016-06-21 15:08:44 UTC
(apologies, cross-posted)
Comment 5 Andrew Coleman 2016-07-08 13:02:32 UTC
At the meeting on 2016-07-05, the WG agreed to resolve this as follows:

Decided: Adopt this text as the resolution of Bug 29700:
Comments are also not allowed in these productions except where the Comment non-terminal appears.

Action 649-02: Jonathan to add the text "Comments are also not allowed in these productions except where the Comment non-terminal appears."
as the resolution of Bug 29700.
Comment 6 Abel Braaksma 2016-07-20 14:02:46 UTC
This was resolved as per confirmation here: https://lists.w3.org/Archives/Public/public-xsl-query/2016Jul/0018.html.

Checked, looks good, thanks.