<div>I switched versions of WebSphere (to 9.0.2.17) and am now getting a more detailed stack trace (any ideas?)</div> <div> </div> <div>javax.xml.transform.TransformerException: org.jdom.IllegalAddException: A DocType cannot be added after the root element<BR> at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2379)<BR> at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2245)<BR> at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1334)<BR> at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:738)<BR> at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1251)<BR> at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1229)<BR> at org.jdom.transform.XSLTransformer.transform(XSLTransformer.java:234)</div> <div> </div> <div>Caused by:
org.jdom.IllegalAddException: A DocType cannot be added after the root element<BR> at org.jdom.ContentList.documentCanContain(ContentList.java:169)<BR> at org.jdom.ContentList.add(ContentList.java:205)<BR> at org.jdom.ContentList.add(ContentList.java:140)<BR> at java.util.AbstractList.add(AbstractList.java:102)<BR> at org.jdom.Document.addContent(Document.java:319)<BR> at org.jdom.DefaultJDOMFactory.addContent(DefaultJDOMFactory.java:177)<BR> at org.jdom.input.SAXHandler.startDTD(SAXHandler.java:711)<BR> at org.jdom.transform.JDOMResult$DocumentBuilder.startDTD(JDOMResult.java:592)<BR> at org.apache.xml.serializer.ToHTMLSAXHandler.startElement(ToHTMLSAXHandler.java:524)<BR> at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:626)<BR> at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393)<BR> at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)<BR> at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2374) <BR><BR><B><I>Jason Shapiro </I></B>wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"> <DIV>I'm running into a strange issue and am hoping someone here has some advice on how to best troubleshoot the problem. </DIV> <DIV> </DIV> <DIV>I have a very simple XSLT operation (producing HTML), using the XSLTransformer class:</DIV> <DIV> </DIV><FONT size=2> <DIV align=left>XSLTransformer transformer = </FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> XSLTransformer(xsl);</DIV> <DIV>Document doc2 = transformer.transform(doc);</DIV> <DIV> </DIV> <DIV>When I run this in a JDK 1.4 / Tomcat configuration, the Document is returned that looks exactly as I would expect it (an HTML
document). When I use the same code in a JDK 5 / WebSphere configuration, the Document object doesn't contain any elements (so when I try to display with an "toString" or "XMLOutputter", I get the following exception message: 'A DocType cannot be added after the root element'). </DIV> <DIV> </DIV> <DIV>My guess is that this is ultimately related to some Xalan / Transformer issue, but I'm not sure what the best way is to determine what's being used (vs. what should be used).</DIV> <DIV> </DIV> <DIV>Any advice is appreciated.</DIV> <DIV> </DIV> <DIV>Regards,</DIV> <DIV>Jason</DIV></FONT> <div> <HR SIZE=1> </BLOCKQUOTE><p> 
<hr size=1>Access over 1 million songs - <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/">Yahoo! Music Unlimited.</a>