There is an xml file whose contents are
<!-- Comments -->
<?xml version='1.0' encoding='UTF-8'?>
<stuff>
</stuff>
I'm not able to parse the file because the parser requires that
<?xml version='1.0' encoding='UTF-8'?>
is the first line of the file, whereas we have comments at the top of the file.
Is there a feature to ignore comments at the top of the file?
BTW, factory.setIgnoringComments(true) did not work.
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setIgnoringComments(true);
DocumentBuilder builder;
try
{
builder = factory.newDocumentBuilder();
System.out.println(builder.getClass());