DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
factory.setValidating(validating);
//Create the builder and parse the file
Document doc = factory.newDocumentBuilder().parse(new
File(filename));
return doc;
The file structure is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<tree>
<node>
<label>Configuration</label>
<clickable>false</clickable>
<tooltiptext>Configuration panel</tooltiptext>
<displayclass>MyJPanel</displayclass>
<depth>0</depth>
<icon>configure.png</icon>
</node>
<node>
<label>Users</label>
<clickable>true</clickable>
<tooltiptext>User Configuration</tooltiptext>
<displayclass>MyJPanel</displayclass>
<depth>1</depth>
<icon>user.png</icon>
</node>
</tree>
The problem is that in one file, which is standalone, I the parsing
goes through successfully. But in the other file, which is part of a
huge application, the parsing fails and gives this error "Content is
not allowed in prolog".
How is this possible ?
Please help me as I am not able to figure out where the problem is
stemming from.
Thanks and regards.