By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Xerces xml Parsing error

P: n/a
Dan
Hi,
I've just installed Xerces 2.5 to try and use SAX to parse some xml (was
having problems before).

Now every time I attempt to parse, I'm getting the following:
org.xml.sax.SAXParseException: Content is not allowed in prolog.

The xml is:
<?xml version="1.0"?>
<message sender="sadasdssad" dateSent="Feb 26, 2004 3:55:24 PM CST">
<messageBody>
sadsadadsa
</messageBody>
</message>

The code is:
<CODE>
StringReader stringReader = new StringReader(message);
InputSource in = new InputSource(stringReader);
parser = new SAXParser(); //org.apache.xerces.parsers.SAXParser
parser.setContentHandler(this);
System.out.println("About to Parse.");
System.out.println(message.charAt(0)); // first char is firschar of prolog
parser.parse(in);
</CODE>

Does anyone have any idea what's going on here? I've been beating my head
against a wall for a day now.

Thanks in advance,

D.
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.