[jdom-interest] Getting String from a Document

Wesley Biggs wbiggs at elite.com
Wed Jun 14 11:48:15 PDT 2000


ByteArrayOutputStream os = new ByteArrayOutputStream();
xmlOutputter.output(document, os);
String theOutput = os.toString();


-----Original Message-----
From: jon.a.gudmundsson at decode.is [mailto:jon.a.gudmundsson at decode.is]
Sent: Wednesday, June 14, 2000 2:39 AM
To: jdom-interest at jdom.org
Subject: [jdom-interest] Getting String from a Document


Hi all,

I am using beta 4 to process and create XML files. My problem is that I am
creating a stand alone class that will create XML from some parameters and
I want the member functions to return a String object containing the XML,
as the class doesn´t know whether the XML will be written to file or
whatever. I am unable to find a way to to this, as the XMLOutputter only
uses OutputStreams..

does anyone know how this can be done ?

Regards,

/**
*  Jón Arnar Guðmundsson
*  Software Engineer          / Hugbúnaðarhönnuður
*  deCODE Genetics, Inc.  / Íslensk Erfðagreining
*/
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list