Attached is a simple servlet which uses XSLT to generate HTML and send it back to the browser. The XSL file needed to run the servlet is attached to, simply put it in the root of the context you have the servlet in.
Hope this helps Jim > Date: Tue, 18 Jan 2000 08:43:58 +0200 > From: Sergei Batiuk <[EMAIL PROTECTED]> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]> > To: Tomcat User Group <[EMAIL PROTECTED]> > Subject: Dynamic XML/XSLT with Tomcat 4.0 > > Hello, > > I would like to use XML/XSLT in my project. The problem is that my XML pages > (and possibly XSLT pages) will be dynamic not static. I think, JSPs should > generate the content, but how do I tell Tomcat to process them with the XSLT > processor? > -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
XsltServlet.java
Description: Binary data
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> <title>XSL Test</title> </head> <body > <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="left"> <B><FONT STYLE="color: #336699">User id: </FONT></B> </td> <td align="left"> <xsl:value-of select="DOCUMENT_BODY/USER/USER_ID" /> </td> </tr> <tr> <td align="left"> <B><FONT STYLE="color: #336699">User name: </FONT></B> </td> <td align="left"> <xsl:value-of select="DOCUMENT_BODY/USER/USER_FIRST_NAME" /> <xsl:value-of select="DOCUMENT_BODY/USER/USER_LAST_NAME" /> </td> </tr> </table> </body> </html> </xsl:template> </xsl:stylesheet>
-- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
