[jdom-interest] dump a document to a string
Ken Rune Helland
kenh at csc.no
Mon Dec 11 23:19:20 PST 2000
On Mon, 11 Dec 2000, Jason Hunter wrote:
> Read the Javadocs for XMLOutputter. Look for methods that return
> Neil Burnett wrote:
> > Can I dump a Document to a String using XMLOutputter(" ",true) (or
> > anything else?).
> > Neil
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://email@example.com
> To control your jdom-interest membership:
The XMLoutputter writes to a outputstream or writer object.
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
org.jdom.output.XMLOutputter outputter = new org.jdom.output.XMLOutputter();
Java has outputstream and writer objects that stores what writen to them
in byte arrays (java.io.ByteArrayOutputStream) , string(buffer)
(StringWriter) or Character arrays (CharArrayWriter).
You also have reader/inputstream classes if you need to
read any of these as a stream.
More information about the jdom-interest