Ian Roberts wrote:
> 
> On Thu, 21 Jun 2001, Martin Farrell wrote:
> 
> > I have a method that will create an xml output (a.toXML()) as a String. Now
> > my problem is that I would like to parse this String directly, and reduce
> > the overhead of file creation in my application
> 
> Create a parser instance, set up the appropriate features and then call:
> 
> parser.parse(new InputSource(new StringReader(a.toXML())));

An improvement to avoid unexpected NullPointerExceptions:

  InputSource in = new InputSource(new StringReader(a.toXML()));
  in.setSystemId("non null");
  parser.parse(in);

  Cc.

-- 
<address>
<a href="mailto:[EMAIL PROTECTED]";>Petr Kuzel</a>, Sun Microsystems
: <a href="http://www.sun.com/forte/ffj/ie/";>Forte Tools</a>
: XML and <a href="http://jini.netbeans.org/";>Jini</a> modules</address>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to