Hi, I want to open XML files, also non well formed ones, to show the XML tags into my java application.
Actually I'm using Xerces2-J to parse XML files, but if I try to open a non-well formed file, the parser throws the SaxException.
How can I open this files?
Thanks
Well, "non-well formed" xml simply isn't xml. Compare a Java source text that
contains syntax errors; it isn't Java and there is (almost) nothing you can do
about it. You can parse the "non-well formed" xml text until it doesn't make sense
anymore; you even don't know what to do at that point: e.g. insert a correct token
or adjust the current token or just delete it. "non-well formed" is just a euphemism
for "it isn't"; it takes a human to decide how to correct that text; computers aren't
of much help here.
kind regards,
Jos