Friday, 25 March 2016

XML : Parse XML file in Java and output all errors

I am currently trying to parse an XML file in Java. I have done lots of research and tried using many of the available libraries such as DOM, SAX, etc. All of these are great and have lots of options. My issue though is I want to be able to parse an entire XML file then output any errors that may be there. With SAX for example, it will parse the file, but only output the first syntax error. Is there anyway to output all errors at once like a compiler can or am I out of luck?

If this is not possible, I am attempting a work around to parse my XML file like a normal text file and grab all the opening and closing tags. Is there a simpler way to do this besides creating many conditional statements and rules?

Any help is greatly appreciated.

Thanks

No comments:

Post a Comment