blob: b3c3c5f6c57674c1350c8604735b06cbb55c0659 [file] [log] [blame]
=======================================================================
CONTENTS OF THIS DOCUMENT:
o) HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE
o) HOW TO INVOKE TRANSLETS FROM A SERVLET
o) TIPS FOR RUNNING THE SAMPLE ON TOMCAT
-----------------------------------------------------------------------
HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE
With XSLTC, XSL transformations can be run from within a servlet.
This sample code demonstrates how that can be implemented.
The CompiledEJB and CompiledBrazil sample code demonstrate other
aproaches to providing XSL transformations as a web service.
-----------------------------------------------------------------------
HOW TO INVOKE TRANSLETS FROM A SERVLET
The CompiledServlet directory contains the example source code:
TransformServlet.java
This file contains a minimal implementation of an XSL transformation
servlet. When you deploy your servlet, make sure that the XSLTC
TransformerFactory will be used by either setting the system property
"javax.xml.transform.TransformerFactory" with the value
"org.apache.xalan.xsltc.trax.TransformerFactoryImpl", or by making a
file with the name "META-INF/services/javax.xml.transform.TransformerFactory"
containing the single line
org.apache.xalan.xsltc.trax.TransformerFactoryImpl
available on your CLASSPATH.
-----------------------------------------------------------------------
TIPS FOR RUNNING THE SAMPLE ON TOMCAT
When compiling the java files supplied with the sample, you need to
add xalan.jar, xml-apis.jar, xercesImpl.jar and servlet.jar
(in %Tomcat_Home%/common/lib) to the classpath
o Copy the latest xalan.jar to %Tomcat_Home%/common/endorsed
o Create a JAR file containing your translet classes and a file
named META-INF/services/javax.xml.transform.TransformerFactory in
your JAR file that contains the following line:
org.apache.xalan.xsltc.trax.TransformerFactoryImpl
o Copy the JAR file, xalan.jar, xercesImpl.jar and xml-apis.jar to your
Web_application_context/WEB-INF/lib
o Make sure that the value of the "class" parameter is the same as
the name of the translet .class or a valid xsl URI
o Make sure that the value of the "source" parameter is a valid
xml URI
o Make sure that the value of the "sheet" parameter is a valid
xsl URI
o The translet .class generated by CompiledServlet will be placed
under %Tomcat_Home%/bin/
-----------------------------------------------------------------------
END OF README