<div>Thanks - I'm now able to see what the difference is:</div>  <div>&nbsp;</div>  <div>The DOCTYPE,&nbsp;declared in&nbsp;the "xsl:output" element is produces two slightly different Strings (depending on whether I'm in Tomcat with JDK 4 or Websphere with JDK 5). The difference being whether or not there is a space between the System ID and the Public ID</div>  <div>&nbsp;</div>  <div>The correct version (in Tomcat):</div>  <div>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<A href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</A>"&gt; </div>  <div>&nbsp;</div>  <div>The incorrect version (in Websphere):</div>  <div>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""<A href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</A>"&gt;</div>  <div>&nbsp;</div>  <div>It looks like this was a known issue and
 eventually fixed(?)</div>  <div><A href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6259810">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6259810</A></div>  <div>&nbsp;</div>  <div>Thanks again for your help!</div>  <div>-Jason<BR><BR><B><I>Mattias Jiderhamn&nbsp;</I></B>wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><FONT size=2>Why not try to use some other output than JDOM (like a StreamResult) and then compare the output from the two configurations?<BR></FONT>Since JDOM complains in one case but not the other, there has to be a difference.<BR><BR>At 2007-01-17 23:14, Jason Shapiro wrote:<BR>  <BLOCKQUOTE class=cite cite="" type="cite">I switched versions of WebSphere (to 9.0.2.17) and am now getting a more detailed stack trace (any ideas?)<BR>&nbsp;<BR>javax.xml.transform.TransformerException: org.jdom.IllegalAddException: A DocType cannot be added after the root element<BR>&nbsp;at
 org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2379)<BR>&nbsp;at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2245)<BR>&nbsp;at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1334)<BR>&nbsp;at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:738)<BR>&nbsp;at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1251)<BR>&nbsp;at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1229)<BR>&nbsp;at org.jdom.transform.XSLTransformer.transform(XSLTransformer.java:234)<BR>&nbsp;<BR>Caused by: org.jdom.IllegalAddException: A DocType cannot be added after the root element<BR>&nbsp;at org.jdom.ContentList.documentCanContain(ContentList.java:169)<BR>&nbsp;at org.jdom.ContentList.add(ContentList.java:205)<BR>&nbsp;at org.jdom.ContentList.add(ContentList.java:140)<BR>&nbsp;at
 java.util.AbstractList.add(AbstractList.java:102)<BR>&nbsp;at org.jdom.Document.addContent(Document.java:319)<BR>&nbsp;at org.jdom.DefaultJDOMFactory.addContent(DefaultJDOMFactory.java:177)<BR>&nbsp;at org.jdom.input.SAXHandler.startDTD(SAXHandler.java:711)<BR>&nbsp;at org.jdom.transform.JDOMResult$DocumentBuilder.startDTD(JDOMResult.java:592)<BR>&nbsp;at org.apache.xml.serializer.ToHTMLSAXHandler.startElement(ToHTMLSAXHandler.java:524)<BR>&nbsp;at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:626)<BR>&nbsp;at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393)<BR>&nbsp;at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)<BR>&nbsp;at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2374) <BR><BR><B><I>Jason Shapiro </I></B>wrote:<BR>  <DL>  <DD>I'm running into a strange issue and am hoping someone here has some advice on how
 to best troubleshoot the problem.&nbsp; <BR>  <DD><BR>&nbsp;  <DD>I have a very simple XSLT operation (producing HTML), using the XSLTransformer class:<BR>  <DD><BR>&nbsp;  <DD><FONT size=2>XSLTransformer transformer = </FONT><FONT color=#7f0055 size=2>new</B></FONT> XSLTransformer(xsl);<BR>  <DD>Document doc2 = transformer.transform(doc);<BR>  <DD><BR>&nbsp;  <DD>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).&nbsp; 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').&nbsp;&nbsp; <BR>  <DD><BR>&nbsp;  <DD>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).<BR>  <DD><BR>&nbsp;  <DD>Any advice is appreciated.<BR>  <DD><BR>&nbsp;  <DD>Regards,<BR>  <DD>Jason<BR><BR></DD></DL><BR>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> <BR>_______________________________________________<BR>To control your jdom-interest membership:<BR><A href="http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com" eudora="autourl">http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com</A> </BLOCKQUOTE></BLOCKQUOTE><BR><p>&#32;

<hr size=1>Expecting? Get great news right away with <a href="http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html">email Auto-Check.</a><br>Try the <a href="http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html">Yahoo! Mail Beta.</a>