Hi,
I like jaxp: http://java.sun.com/xml/jaxp.html
used like this:
import javax.xml.transform.stream.*;
import javax.xml.transform.*
import java.io.*;
import javax.servlet.http.*;
StreamSource stylesheet = new StreamSource(new File("/path/to/stylesheet.xsl"));
Transformer transformer =
TransformerFactory.newInstance().newTransformer(stylesheet);
transformer.setParameter("parameterName","parameterValue");
transformer.transform(new StreamSource(new File("/path/to/xml.xml")), new
StreamResult(response.getWriter());
If your version of xalan knows about jaxp (recent versions do) and is in your
classpath at run time, xalan will be used. It is nice because it removes
dependancy of your code on a particular xslt implementation.
Charles
Anand wrote:
> I am new to this xalan and xslt world. Any help is very much appreciated.
>
>
>
> I am working on a web application development using jsp/servlets and may
> be ejbs.
>
> We are inclined towards using xml/xslt for some data independencies.
>
> I wonder can we write xslts which take some parameters from caller
> (could be jsp/servlet) and transforms the xml accordingly?
>
> Is this possible if i use xalan? Any simple examples are very much
> appreciated. I also wonder if there are any resources on web for
> reference on application development using xalan/jsp/servlets.
>
>
>
> Thanks
>
> Anand
>