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

Re: Repart generation with XSL Stylesheet

Subject: Re: Repart generation with XSL Stylesheet
From: "Denis McCarthy" <dmccarthy@xxxxxxxxxxxxxxxx>
Date: Tue, 2 Jul 2002 11:34:14 +0100
javax.xml msxsl
If I unerstand you properly I have tried something similar; I passed an xml
and a corresponding xsl file into a jsp, and got xalan to transform the xml.
Here is the valid code:

<%@ page language="java" contentType="text/html" %>
<%@ page import="javax.xml.transform.*,javax.xml.transform.stream.*"%>

Locale locale =
SessionManager.getUserProfile(request).getLocale().getLocale();
String xmlFile = "http://localhost/static/xml/" + locale.getLanguage() + "_"
+ locale.getCountry() + "/contact_details.xml";

String xslFile    = http://localhost/static/xsl/contactDetailsToHTML.xsl";
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new
StreamSource(xslFile));
transformer.transform(
        new StreamSource(xmlFile), new StreamResult(out));

As you can see the xmlFile is static; I think for your example you would be
better to dynamically generate the xml and pass it to the page as an
InputStream (the StreamSource class can take an InputStream or indeed a
Reader as a constructor as well as a File or URL)
Hope this helps



----- Original Message -----
From: "Ranjith Kodikara" <Ranjith@xxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, July 02, 2002 10:16 AM
Subject:  Repart generation with XSL Stylesheet


> We are developing a information selling system for a chamber of commerce
and
> we want to generate reports for user requests. First we let users to
select
> a query criteria. Then I hope to generate an xml document; which is a jsp
> file generated from the database, with xml content type. Then at the
moment
> my idea is to generate an html document by parsing that xml file via an
xsl
> stylesheet.
> Do you think this method is suitable? Then can I write an xsl stylesheet
> with jsp.
> If I generate html's with xml files using Xalan , when users are
generating
> reports doesnt the folder in the web server get filled with html files?
>
> Those are the questions I have. I am considering to do this with xml and
> Xalan parser. Pls advice me.
>
> -Ranjith
>
>
>
>  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

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-2013 All Rights Reserved.