[jdom-interest] XMLOutputter bug?

Philipp Sumi sumi at datenreich.ch
Mon Apr 8 07:12:13 PDT 2002


Hello

I've recently read an article by Brett McLaughlin concerning JDOM & XSLT and
tried to implement the sample code, which can be found at
http://www-106.ibm.com/developerworks/java/library/x-tipjdom.html

I don't know why, but when using the pipes as below, Tomcat hangs while
outputting. If I use the XMLOutputter with something different (e.g. another
StringWriter) everything works fine. Is this a bug in the API or in my code?

Thanks for your advice

Philipp


public void renderDoc (Document document) {
          // I/O streams for Source
          PipedInputStream sourceIn = new PipedInputStream();
          PipedOutputStream sourceOut = new PipedOutputStream(sourceIn);
          StreamSource source = new StreamSource(sourceIn);

          //initialisation of Streamresult - shouldn't interfere, I guess
          writer = new StringWriter ();
          StreamResult result = new StreamResult(writer);

  System.out.println("this comment is displayed");

          // Output to pipe
          xmlOutputter.output (document, sourceOut);
          sourceOut.close();
  System.out.println("this is never displayed");
          //more code...
}




More information about the jdom-interest mailing list