I was trying to parse an XMLfile created using Visual Studio using a tool which uses Xerces parser and I got “content not allowed in prolog” error.
Now when I create an XML file using some other editor like notepad++ and have the exact same content as the one created above I don’t get this error.
What do you think might be the problem. You might understand that this is not a repeat question.
EDIT
So i found out the problem. Its because the tool which i use could not handle the Bom at the beginning of the file
The file starts with a UTF-8 byte-order mark. The XML specifications say that documents may start with a BOM, so it should be fine. Is it possible that the tool uses an old version of Xerces which didn’t cope with a BOM? Other than that, the file looks fine to me.
Is this a tool you have the source code to? Are you able to create a short but complete program which demonstrates the problem, failing to parse it? Can you try a later version of Xerces?