You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steffen Gransow <gr...@gmx.de> on 2001/04/19 13:23:52 UTC

JDOM and JAXP

Hi,

I wrote a tiny servlet that builds a JDom-document from a mySQL database
table. After building the document in memory I want the document to be
transformed to HTML (using a xsl-stylesheet and JAXP/Trax). This process fails. When I
use the code to write the result to a file it works. When I try to output it
to the ServletOutputStream it fails. What do I do wrong? Possibly it's a
version conflict of the jaxp.jar file. I put all the jars my servlet needs in
the WEB-INF/lib directory of my web-app. Of course there's a jaxp.jar in it.
What can I do to make this work? Is there a way to replace the jaxp.jar of
tomcat with the other jaxp.jar? Or are there any other possibilities to solve
my problem?

code snippet:

Transformer transformer =
TransformerFactory.newInstance().newTransformer(new StreamSource("d:/test1.xsl"));
transformer.transform(new JDOMSource(doc), new
StreamResult(res.getOutputStream()));

When I use FileOutputStream (and not res.getOutputStream) it works I think.

Thanks in advance.

Regards

Steffen Gransow

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net