[jdom-interest] XMLOutputter & StringWriter

Jason Hunter jhunter at collab.net
Thu Jun 29 13:05:07 PDT 2000


> Judging from the below snippet (taken from XMLOutputter.java)
> the output method took a PrintWriter in its earlier life.
> 
> This seems to be a docu bug BTW (also in other locations).

If you look to the latest CVS tree, it's already fixed.

> What I want to do is to write the document into a java.io.StringWriter so
> that I can capture the string and display it in a Swing component.
> Understandably I do not want it written into an encoded _byte_ stream.
> 
> Has anybody needed something like this before? How to do it?
> I guess adding
> public void output(Document doc, java.io.StringWriter out)
> would be easy, but maybe there is a sanctioned way to do it?

There's an output(Document, Writer) method in the CVS tree.

-jh-





More information about the jdom-interest mailing list