Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Repart generation with XSL Stylesheet

From: "Denis McCarthy" <dmccarthy@---------------->
To:
Date: 7/2/2002 2:34:00 AM
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: [xsl] 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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent