Re: [xsl] XSLT implementation

Subject: Re: [xsl] XSLT implementation
From: "Robert Koberg" <rob@xxxxxxxxxx>
Date: Mon, 9 Jul 2001 13:36:48 -0700
is resin trying to be a spec compliant xsl processor? it seems they
encourage using extensions too. WHat I like about resin is it was really
easy to setup, use and the automatic recompile of the servlets (just edit
the java file, save and refresh the browser) - maybe tomcat has this feature
too, i just don't know where it is...

TO transform your xml with xsl on the server you could use xalan
(http://xml.apache.org) or saxon (http://users.iclway.co.uk/mhkay/saxon/) as
the xsl processor. Each has examples on how to use with servlets.

Basically, you will put the appropriate (xalan or saxon) jar in your lib
directory. Then on server tomcat startup you will get the classes from the
xsl processor. Some basic code:
------
// xsl specific
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
--------------

---------
      PrintWriter out = new PrintWriter (res.getOutputStream());
      res.setContentType("text/html");

      try {
         TransformerFactory tFactory = TransformerFactory.newInstance();
         Transformer transformer = tFactory.newTransformer(new
StreamSource(xsl));

         for (var i=0; i<params_prop.length; i++) {
            transformer.setParameter(params_prop[i],params_value[i]);
         }

         transformer.transform (new StreamSource(xml), new
StreamResult(out));

      } catch (Exception e) {
         out.write(e.getMessage());
         e.printStackTrace(out);
      }

      out.close();


----- Original Message -----
From: "Jean-Baptiste Quenot" <jb.quenot@xxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, July 09, 2001 12:51 PM
Subject: Re: [xsl] XSLT implementation


> * Sunil Dua:
>
> > I am a web developer, I  have been learning XML/XSL/XSLT/DTD at my own
> > since last 6 months...... I just want to know how can I use them in my
> > web services...like  how do I configure  my web server ..say  I have a
> > jakarta tomcat server.....I am able to generate XML but still not able
> > how do I apply XSLT/XSL .... Could any of you help me on this?
>
> Switch to Resin: http://www.caucho.com/ It  has an XSLT engine embedded,
> works fine.  IMHO  the best Servlets / JSP server,  and it's free unless
> you make profit with it.
>
> Believe me,  I was  also a Tomcat  user, before.  Give  Resin a  try, it
> beats all comparisons.
>
> Cheerio!
> --
> Jean-Baptiste Quenot
>
>  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