  | |  | javax.xml.transform.Transformer | javax.xml.transform.Transformer 2003-07-22 - By Daniel Herbison
I'm using this code to transform xml using and xsl file: TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(xsl); transformer.setOutputProperty("omit-xml-declaration","yes"); transformer.transform(new StreamSource(xml),sr);
When I run the code in a Tomcat standalone installation everything works great! However when I run the code under tomcat from Apache using the mod_jk connector I get an error (below) on the "tFactory.newTransformer(xsl)" line. Done anyone have any idea what is happening? org.xml.sax.SAXParseException: White spaces are required between publicId and systemId.
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:118 9)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFa ctoryImpl.java:934)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Transformer FactoryImpl.java:750)
at com.nortel.nmm.util.CoiXML._transform(CoiXML.java:124)
at com.nortel.nmm.util.CoiXML.transform(CoiXML.java:115)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.00.3315.2870" name=GENERATOR></HEAD> <BODY> <DIV><FONT face=Arial size=2><SPAN class=341212214-22072003>I'm using this code to transform xml using and xsl file:</SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN class=341212214-22072003></SPAN></FONT> </DIV> <DIV><FONT face=Arial size=2><SPAN class=341212214-22072003> TransformerFactory tFactory = TransformerFactory.newInstance();<BR> Transformer transformer = tFactory.newTransformer(xsl);<BR> transformer .setOutputProperty("omit-xml-declaration","yes");<BR>   ;transformer.transform(new StreamSource(xml),sr);<BR></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN class=341212214-22072003>When I run the code in a Tomcat standalone installation everything works great! However when I run the code under tomcat from Apache using the mod_jk connector I get an error (below) on the "tFactory.newTransformer(xsl)" line. Done anyone have any idea what is happening?</SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN class=341212214-22072003></SPAN></FONT> </DIV> <DIV><SPAN class=341212214-22072003> <P><FONT face=Arial size=2>org.xml.sax.SAXParseException: White spaces are required between publicId<SPAN class=341212214-22072003> </SPAN>and systemId.</FONT></P> <P><FONT face=Arial size=2>at<SPAN class=341212214-22072003> </SPAN>org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java :118</FONT><FONT face=Arial size=2>9)</FONT></P> <P><FONT face=Arial size=2>at<SPAN class=341212214-22072003> </SPAN>org.apache.xalan.processor.TransformerFactoryImpl.newTemplates (TransformerFa</FONT><FONT face=Arial size=2>ctoryImpl.java:934)</FONT></P> <P><FONT face=Arial size=2>at<SPAN class=341212214-22072003> </SPAN>org.apache.xalan.processor.TransformerFactoryImpl.newTransformer (Transformer</FONT><FONT face=Arial size=2>FactoryImpl.java:750)</FONT></P> <P><FONT face=Arial size=2>at com.nortel.nmm.util.CoiXML._transform(CoiXML.java:124)</FONT></P> <P><FONT face=Arial size=2>at com.nortel.nmm.util.CoiXML.transform(CoiXML.java:115)</FONT></P></DIV></SPAN>< /BODY></HTML>
|
|
 |