I am using java SimpleXML to parse XML from a number of applications.
Many applications create quirky XML implementations of this supposed 'standard', such as putting in an 'enabled' tag more than once.
In this situation, I just want to ignore the second one as it is a mistake and has same value as first anyway, but SimpleXML throws an exception "Element 'enabled' is already used"
How do I prevent this?
This is the field that is complained about.
@Element(required = false)
protected boolean enabled = true;
The XML is huge so don't want to post it. Is there a way to get SimpleXML to report the line number that the caused the error?