[jdom-interest] Facing problem reading comments data, need help

Jason Hunter jhunter at servlets.com
Sat Jul 7 23:40:45 PDT 2007


Michael Kay wrote:
>> It's a malformed XML document. ...
> 
>> JDOM sounded off stating that the data is not legal for a JDOM comment:
> Comment data 
>> cannot start with a hyphen, giving an IllegalDataException.
> 
> Where does it say that a comment cannot start with a hyphen? The rule is
> that it cannot contain two consecutive hyphens, and it cannot end with a
> hyphen.

Good point.  I figured Rusty did the right thing with the Verifier code, 
but looking at the BNF:

Comment	::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'

That's just a fancy way to say no two consecutive hyphens, not an 
exclusion of a leading hyphen.

-jh-


More information about the jdom-interest mailing list