tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ron riley <r.ri...@lse.ac.uk>
Subject XSL Transformations under 4.1 and jdk1.4.1 always validating?
Date Mon, 14 Apr 2003 16:07:28 GMT
Hi

I'm having trouble performing xsl transformations in Tomcat 4.1 running in 
sun's jdk1.4.1.  

We have a class, called XMLTransformer that is used by servlets to parse 
templates which includes the following in its constructor:

  ...
  //instantiate a transformer factory
    tFactory =  javax.xml.transform.TransformerFactory.newInstance();
    templates = tFactory.newTemplates(strNameOfXslFile);
  ...

If I invoke this class outside of tomcat like this:  

$JAVA_HOME/bin/java  -Djava.endorsed.dirs=/opt/tomcats/LIVE/common/endorsed  
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl
 
-classpath XMLTransformer_path XMLTransformer an_xsl_file

then an instance of the class in instantiated and everything is fine.  
However, the same class invoked on the same xsl_file produces the following 
error when run in tomcat:

[Fatal Error] fees.xsl:1:50: White spaces are required between publicId and 
systemId.
ERROR:  'White spaces are required between publicId and systemId.'
SAXException (1)
javax.xml.transform.TransformerConfigurationException: Could not compile 
stylesheet
        at 
org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:745)
        at XMLTransformer.<init>(XMLTransformer.java:139)

I believe the environment is the same in both cases:

The latest releases of xalan.jar, xercesImpl.jar, xml-apis.jar,  
xmlParserAPIs.jar and xsltc.jar have been put into 
$TOMCAT_HOME/common/endorsed

The line -Djava.endorsed.dirs=$CATALINA_HOME/common/endorsed is in the command 
line that starts the container.

setenv.sh includes 
JAVA_OPTS=-Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl


The error message suggests that a parser is trying to validate the xsl file? 
The xsl file contains no dtd and I don't want it to be validated.  I can't 
find any way to switch validation on/off in the 
org.apache.xalan.TransformerFactory api - but somehow it is being switched on 
by tomcat?

If anyone can explain what is happening or knows what to do about this I'd 
really like to hear from them!

Many thanks

Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message