This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The current grammar seems to allow whitespaces and especially comments between the $ and the QName. Can the grammar please locally be written such that the Variable name is clearly identified as $QName and comments are not allowed?
This comment has been made a number of times, and I've never understood the rationale for it. We allow whitespace after the @ in @att, and before the "(" in text(), in fact everywhere where names appear adjacent to punctuation symbols. Why make an exception for this one? XPath 1.0 had this restriction, as it happens, and I was very pleased to delete the dozen lines of contorted code in my parser that enforced it.
The only plausible way to make this change would be to make VariableReference a token type. (The only alternative I can think of is an ad hoc rule, which lacks motivation.) That would involve changes to productions 5 and 6, which is not too onerous. But it would also mean having a token type with significant internal structure, and the rules for QNames (both syntactic and semantic) would have to be either repeated between the token grammar and the main grammar or else those rules have to be shared between the grammars, which seems like a violation of modularity. I think the general principle that tokens should be treatable as atoms suffices to lead us to reject this proposal.
A joint meeting of the Query and XSLT working groups considered this comment on July 20, 2005. The WG has concensus that we do not wish to make a change. If you do not agree with this resolution, please add a comment explaining why. If you wish to appeal the WG's decision to the Director, then change the Status of the record to Reopened. If we do not hear from you in the next two weeks, we will assume you agree with the WG decision.