Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Content is not allowed in prolog

4 views
Skip to first unread message

FET

unread,
May 27, 2004, 1:52:47 AM5/27/04
to
Hello,
I have a pretty strange problem:
There are 2 java files in which I have written the following code:

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.

0 new messages