FW: XML grammar error?

Forwarding:
http://lists.w3.org/Archives/Public/xml-editor/2011OctDec/0010


-----Original Message-----
From: bacchi raffaele [mailto:bacchi_raffaele@lycos.com] 
Sent: Monday, 2011 December 12 3:45
To: xml-editor@w3.org
Subject: XML grammar error?

I think that rule [20] (and other similar) are wrong:

CData ::= (Char* - (Char* ']]>' Char*))

The purpose of the rule is to match (reduce) any Char sequence 
not containing ']]>'.  But this result is not achieved since 
the Char definition includes ']' and '>' so the exception part 
of the rule:

-(Char* ']]>' Char*)

is ambiguous. Most parsers solve the ambiguity by applying the 
rule "reduce as soon, as much as possible" thus the rule will 
always mismatch because the first Char* reduces also the sequence 
']]>' and the next terminal ']]>' will never match.

I think the rule (and other similar) should be written:

Cdata ::= ( Char - ']]>' )*

Best regards
Bacchi Raffaele 

Received on Monday, 12 December 2011 14:56:48 UTC