Re: Ambiguity in RNC grammar
Bob Foster <[email protected]> Sat, 08 May 2004 12:23:06 -0500
| Newsgroups | gmane.text.xml.relaxng.general |
|---|---|
| Message-ID | <[email protected]> |
Jeff Rafter wrote: > I have just about finished the translator I am working on for RNC->RNG. I > stumbled upon what I think is an ambiguity in the grammar. Because XML > allows for a "-" in a name, and RNC allows for "-" as part of a dataExcept > (or nameExcept)-- I think that there is a collision. Consider: You are expected to resolve this ambiguity during tokenization (see http://www.oasis-open.org/committees/relax-ng/compact-20021121.html#d0e4256). When the longest initial subsequence of an NCName contains a '-' character, it is part of the name. Therefore, a sequence like: xsd:int-xsd:byte consists of three tokens, a CName 'xsd:int-xsd', an invalid token ':' and an NCName 'byte'. Jing must check the datatype name before scanning the next token, or you would get a syntax error. Other processors might do it in reverse order. Bob Foster