You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Kelly Campbell <ca...@channelpoint.com> on 2001/03/06 22:47:08 UTC

RE: Is it possible ro parse a string instead of parsing a file or steam in Java?

take a look at java.io.StringReader and/or java.io.StringBufferInputStream.
Pass one of these to InputSource

-Kelly

> -----Original Message-----
> From: Christian Muth [mailto:christian.muth@base-system.com]

> I wonder, if it is not possible to parse an ordinary java.lang.String
> containing the xml document, e.g.:
> ( "<user><firstname>John</firstname><lastname>Doe</lastname></user>" )
> 
> I use the sax2 api and xerces for java, but I can only parse regular
> files. I haven't found a possibility to take a normal string
> as the input source.
> Can one help me?