O'Reilly logo

Special Edition Using Java™ 2 Enterprise Edition by Mark Wutka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Applying XSL Templates from a Servlet

XSL becomes a powerful tool when you combine it with the power of servlets and Java Server Pages. You can create XML documents within your server-side Java code and use a style sheet to format the XML into something the client understands.

To apply an XSL style sheet to an XML document from a servlet or JSP, you must have an XSL processor installed in your servlet engine's classpath. The Apache Group's Xalan XSL processor (http://xml.apache.org) is an excellent XSL processor and works well in a servlet environment. IBM's LotusXSL processor, available from http://www.alphaworks.ibm.com, is also good.

Listing 23.5 shows a servlet that takes an XML document or a filename from the request object along with a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required