Reputation: 829
I am using StAX parser to read xml files. Some xml files are not well formatted, means some times end tags might be missing.
Example:
<tag1>
<tag2> </tag2>
<tag3>
<tag4> </tag4>
</tag1>
In this case StAX parser not moving forward when no end tag found. It is only reading up to 'tag3'.
Please suggest me how to solve this or any other parse which can parse the entire file irrespective of file format.
Upvotes: 0
Views: 212
Reputation: 672
The input isn't "not well formatted XML", it isn't XML at all. You should provide a valid XML for an XML parser to work properly, irrespective of STaX or DOM.
Upvotes: 1