aspose file tools
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
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply 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: 12271
    
    1
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:


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Problems parsing a string with SAX
 
Similar Threads
xml parsing from a string
Parsing of a String using DOM or SAX
Parsing input from a string using JAXP, Xerces 1.4.1 with Visual Age
DOMParser
Converting String to XML file?