File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Problems parsing a string with SAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Problems parsing a string with SAX" Watch "Problems parsing a string with SAX" New topic

Problems parsing a string with SAX


Joined: Jul 13, 2001
Posts: 13
i'm attempting to parse a string object like so:
SAXParser parser = new SAXParser();
parser.setContentHandler ( this );
parser.setErrorHandler ( this );
StringReader stringReader = new StringReader(xmlString);
InputSource inputSource = new InputSource(xmlString);
but i keep getting a SAXParseException: File <xmlString> Not Found.
what am i doing wrong?
all i want to do is simply recieve a String Object from a method, and parse the string with SAX. any ideas?
i'm using xerces java 1.
many thanks,
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
It thinks your String is the name of a file. You need to turn the string into a Reader with StringReader or byte InputStream with StringBufferInputStream (deprecated).

author of:
I agree. Here's the link:
subject: Problems parsing a string with SAX
jQuery in Action, 3rd edition