XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
kanchan thukralSubject: how to pass some attribute value from jsp to XSL
Author: kanchan thukral
Date: 09 Sep 2005 05:48 AM
hello,

please tell me how can i pass the value of one attribute from my jsp to xsl.

like that jsp have variable which have FromDate and Todate.
please tell me

kanchan

Postnext
N TSubject: how to pass some attribute value from jsp to XSL
Author: N T
Date: 09 Sep 2005 11:39 AM
Hello,
I am assuming that you need to pass some variable value from JSP to XSL. You would have to pass it in as a parameter.

TransformerFactory transFact =
TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(xsltSource);
trans.setParameter("paramname", strParamValue);

Obviously, there is more to it than this. But this should tell you how to pass it in JSP.

This is how you would receive it in XSL:
<xsl:output method="html"/>
NOTE: this param tag should be a global tag (after stylesheet or output tags).
<xsl:param name="paramname"></xsl:param>

Let me know if this helps and if you have any more questions.

Postnext
kanchan thukralSubject: how to pass some attribute value from jsp to XSL
Author: kanchan thukral
Date: 12 Sep 2005 05:40 AM
hello
in your reply you told me to include this portion of the code in jsp.
but what should i specify instead of this xsltSource.
is this will be the name of the xsl file or what.
please guide me.

TransformerFactory transFact =
TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(xsltSource); <-----
trans.setParameter("paramname", strParamValue);

looking fwd for your reply.

Posttop
N TSubject: how to pass some attribute value from jsp to XSL
Author: N T
Date: 12 Sep 2005 10:04 AM

You will need to create a Source object like this:

Source xsltSource = new StreamSource(xsl);

Here, xsl is an Input Stream. It could also be a URL. But, you will need to pass in the Source.

Let me know if you have any questions.

-Ninad

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.