I'm doing a XML comparison between 2 xml files. My xml files (to be compared) contains a UTF8 BOM (viz.., EF BB BF ) in it. So, when I'm try to invoke the Diff API (of org.custommonkey.xmlunit.XMLUnit.Diff) with UTF8 encoding then I'm getting an exception like :
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
Removing these 3 Hex values (EE, BB & BF) will resolve the problem, but I need a way to set the encoding UTF8, so that the XMLUnit API works even for a UTF8 encoding enabled XML file.
Suggestions are welcomed !