0

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 !

Ragu
  • 187
  • 1
  • 11
  • There is unfortunately no quick-fix for your problem. The accepted answer to the question I linked to has a few suggestions for a 'hard way'. – jarnbjo Apr 15 '16 at 10:37
  • @jarnbjo : So, the only way is to remove the BOM characters ? No API exists for skipping this – Ragu Apr 15 '16 at 11:37

0 Answers0