[jdom-interest] comments lost for xslt

Sonja Löhr sonjaloehr at t-online.de
Thu Aug 15 06:19:02 PDT 2002


Hi, all,

I have a problem matching comments while transforming a jdom.document with
xslt:
When I do the transformation from a jdom.Document (=jdomDoc) I built
before, using JAXP as follows

   Transformer transformer = tFactory.newTransformer(new
StreamSource(xslfile));
   StreamResult result = new StreamResult(new FileOutputStream(outfile));
    transformer.transform(new JDOMSource(jdomDoc), result);

the templates matching the comment() nodes give no result.

However, if I output jdomDoc with the XMLOutputter, the comments are there,
and if I do an
XSLT-transformation with the output file as source, using

   transformer.transform(new StreamSource(xmlfile), result);

everything is ok with the comment()-templates.
Is there any solution for the mismatch between comment() and the jdom
internal representation of comments?

Thanks,

Sonja









More information about the jdom-interest mailing list