Re: [xsl] using Saxon from Tomcat

Subject: Re: [xsl] using Saxon from Tomcat
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Tue, 14 May 2002 07:03:19 -0700
You can keep your XML/XSL under WEB-INF so they are secure. For example:

- basic_app
  |- css
  |- images
  |- WEB-INF
       |- classes
           |- SaxonServlet.class
       |- content
           |-replace_data.xml
       |- styling
           |- test.xsl
       |- lib
           |- saxon.jar

You can set an intitial param for the docroot relative path to your content in your /WEB-INF/web.xml. For example:
<context-param>
<param-name>client.content.dir</param-name>
<param-value>/WEB-INF/content/</param-value>
</context-param>


Then you will need to either getRealPath or getResourceAsStream based on an argument starting from the WEB-INF. For example:

StringBuffer path = new StringBuffer(ServletContextObject.getRealPath(ServletContextObject.getInitParameter("client.content.dir")));
path.append(filename_var);


best,
-Rob


Joeri Belis wrote:


ENV: Linux Redhat 6.1, Saxon 6.5.2, Tomcat 3.3.1

I want to use Tomcat to do an xslt transformation via a servlet.

I have Tomcat up and running and Saxon installed.

Where should i put my xlst, xml files under Tomcat? And what is more needed
to
have the following working.
http://webserver:8080/examples/servlets/SaxonServlet?source=replace_data.xml
&style=test.xsl

I am using the SaxonServlet that came with the saxon samples. Do i need to
change any code in it
or is this a generic version that works for every kind of transformation.

Thanks for any feedback;
Joeri


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list







XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread