[jdom-interest] Parsing a comment like <!--- Hello

Elias Ross eross at m-Qube.com
Tue Nov 2 23:32:08 PST 2004


Thanks guys.  I had expected there was some reason for the restriction. 
Can you add a test case for this?

On Tue, 2004-11-02 at 17:18, Elliotte Harold wrote:
> > That does match the production given in the XML recommendation, so it is 
> > valid XML:
> > 
> > Comment   ::=   '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
> > 
> > The problem is that third "if" in the code, which returns "Comment data 
> > cannot start with a hyphen." - according to the above production, 
> > comment data *can* start with a hyphen, providing the hyphen is followed 
> > by a non-hyphen. Surprised me!
> 
> I'd have to check the CVS logs to be sure, but this one's probably my 
> fault. I just checked the XOM code base and I've got the same mistake 
> there (fixed now, of course). Anyway, just delete the relevant if clause 
> and all should be fine.



More information about the jdom-interest mailing list