You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Holger Schulze <hs...@media-style.com> on 2005/08/15 11:12:22 UTC

org.xml.sax.SAXParseException: Content is not allowed in prolog.

Hi maven users,

since I upgraded my maven version from 1.0-rc2 to 1.0.2 I get errors like 
'org.xml.sax.SAXParseException: Content is not allowed in prolog' if I execute 
junit tests by using maven. From within my eclipse environment the test don't fail.

The errors occur if I try to parse xml strings
with following lines:


Node xml = ....;
Reader source = new StringReader(xml.toString());
....
DocumentBuilderFactory documentFactory = 				DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentFactory.newDocumentBuilder();
InputSource src = new InputSource(source);
Document document = documentBuilder.parse(src);


I get the following exception:

org.xml.sax.SAXParseException: Content is not allowed in prolog.
	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
...


1. Is there a known problem by using the xerces parser implementation?
2. How can I disable the usage of the xerces parser so maven use the default xml 
parser


Thanks Holger



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org