Xerces xml Parsing error
From: Dan (danthony74_at_hotmail.com)
Date: 02/27/04
- Next message: Rasmus Nielsen: "S.O.S!!"
- Previous message: GianpieroP: "Re: JAVA ResultSet Problem?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 26 Feb 2004 23:47:23 GMT
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.
- Next message: Rasmus Nielsen: "S.O.S!!"
- Previous message: GianpieroP: "Re: JAVA ResultSet Problem?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|