[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT Saxon Transformation in JSP pages ?

Subject: XSLT Saxon Transformation in JSP pages ?
From: "Vincent Blondel" <vincent@xxxxxxxxxxxx>
Date: Mon, 4 Sep 2006 11:49:21 +0200 (CEST)
jsp xsl transformation
Hello,

I am a complete newbie with JSP and XSLT Saxon technologies but I am
interested to mix all these together.

I am trying to find an easy way to make xslt transformation (from files)
in my JSP pages through XSLT engine. Below is an example the way I am
currently doing it but I don't find this is so easy nor this is so
elegant.

Furthermore, if I create a Tomcat web application with eclipse and creates
this simple index.jsp page this is working fine without adding any jar
files in WEB-INF/lib directory.

So my questions are :

* How can this work without any jar file ( saxon.jar ) in my web
application, is this comimng from jdk ( 1.5.0_06 ) himself ?
* How can I integrate my XSLT transformation with saxon exngine ?
* Is there a way to make this easier , with special Jsp Saxon tags ?

  ---
  index.jsp
  ---

<%@ page contentType="text/html"
         import="javax.xml.parsers.*,
              org.w3c.dom.*,
              javax.xml.transform.*,
              javax.xml.transform.stream.*,
              java.io.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
        <head>
          <title>Title</title>
        </head>

        <body>
<%
StreamSource xml = new StreamSource(new File("c:/temp/hello.xml"));
StreamSource xsl = new StreamSource(new File("c:/temp/hello.xsl"));

StreamResult result = new StreamResult(out);

TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(xsl);

transformer.transform(xml, result);
%>
        </body>
      </html>


Regards
Vincent

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.