[jdom-interest] Problem with xsl transform

Zetterman, Erik erik.zetterman at cgey.com
Thu Aug 22 02:25:25 PDT 2002


I'm having problems with xsl tranformation from JDOM document object
(JDomSource). The produced html file is fine except for that all text values
from the xml file is missing. Attribute values does work. Also, transforming
the JDOM document into a W3C document (with DOMOutputter) and do the
transformation on a javax.xml.transform.dom.DOMSource with the same
transformer works fine. 

This does not work:
      Transformer trans;
      TransformerFactory factory = TransformerFactory.newInstance();
      trans = factory.newTransformer(new StreamSource("file:" +
stylesheet));
      trans.transform(new JDOMSource(doc), new StreamResult(out));

But this does:

     Transformer trans;
      TransformerFactory factory = TransformerFactory.newInstance();
      trans = factory.newTransformer(new StreamSource("file:" +
stylesheet));
      System.out.println(trans.getClass().getName());
      trans.transform(new javax.xml.transform.dom.DOMSource(new
org.jdom.output.DOMOutputter().output(doc).getDocumentElement()), new
StreamResult(out));


Any ideas?

Thanks, Erik.


This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.




More information about the jdom-interest mailing list