This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Problems parsing a string with SAX" Watch "Problems parsing a string with SAX" New topic
Author

Problems parsing a string with SAX

mcore
Greenhorn

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);
parser.parse(inputSource);
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,
-MCore
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
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).
Bill

------------------
author of:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems parsing a string with SAX