Skip to main content

Possible bug in SAX Parser handling multi-line comments

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2014-01-15

I hope I'm in the right place, apologies if I'm not.

I'm fairly new to Java, though not new to programming. I'm writing an application that takes quite a lot of configuration from XML files, and I think that I have found a bug in the SAX parser.

I have created an XML file and XSD schema file and checked these for validity on a free validity checker on the web. This reports no errors.

I am running the SAX parser with validation active, though I have also tried it without validation and it makes no difference. The SAX parser reports no errors in the XML syntax. It just corrupts the data that it returns from reading the file.

In order to help myself understand the configuration, I have put some explanatory text into XML comments with the normal XML comment delimitors at the top and bottom. The comments are quite big (around 30 lines). If I remove the multi-line comments, the SAX parser appears to read all of the data from the XML file correctly. The data that gets corrupted is not immediately following the comment but a fair bit later.

Is anyone aware of an issue with the SAX parser handling multi-line comments?

Is there anything else that I should try before I attempt to submit a bug report?