aspose file tools*
The moose likes XML and Related Technologies and the fly likes passing param from request to xsl stylesheet.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "passing param from request to xsl stylesheet.." Watch "passing param from request to xsl stylesheet.." New topic
Author

passing param from request to xsl stylesheet..

Veronica Damian
Ranch Hand

Joined: Feb 04, 2006
Posts: 61
hi,

I need to pass a param in query string of url and pass it to a link that's in XSL..

http://www.mysite.com/attendees.jsp?eventid=<valueHere>

there is a custom tag that prints dynamic content w/an XSL stylesheet..

<placeContentisplayTopArticles ... styleSheet="/xsl/dta_body.xsl">

we cannot alter structure of XML (by adding a tag or a param to an existing tag), so... how to pass 'eventid' param to the XSL stylesheet specified in this tag?

thank you very much..
Veronica Damian
Ranch Hand

Joined: Feb 04, 2006
Posts: 61
PLEASE.. PRETTY PLEASE.. I need an answer.......

thank you very much..



Originally posted by Veronica Damian:
hi,

I need to pass a param in query string of url and pass it to a link that's in XSL..

http://www.mysite.com/attendees.jsp?eventid=<valueHere>

there is a custom tag that prints dynamic content w/an XSL stylesheet..

<placeContentisplayTopArticles ... styleSheet="/xsl/dta_body.xsl">

we cannot alter structure of XML (by adding a tag or a param to an existing tag), so... how to pass 'eventid' param to the XSL stylesheet specified in this tag?

thank you very much..
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18168
    
    8

So you have a custom tag that does XSL transformations. Your question must be how to pass an XSLT parameter to that custom tag, then?

Basically, your question should be addressed to the author of the custom tag, if there is no documentation available. It's possible the author didn't provide a way to pass parameters. Or it's possible they did, too. But there's no way for anybody to tell unless they know something about the tag.
Veronica Damian
Ranch Hand

Joined: Feb 04, 2006
Posts: 61
no no no.. I don't need to pass XSLT param to tag, I need to pass param grabbed from query string in url to XSL stylesheet...

this is what it is:

AffData = request.getParameter("AffiliateData");

this param I need to pass to XSL specified in the tag (tag is in same JSP where code is to grab param..)

<placeContentisplayTopArticles ... styleSheet="/xsl/dta_body.xsl">

how to I pass param grabbed from query string in url to stylesheet specified in custom tag..

thank you very much..
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18168
    
    8

Well, normally in Java you "pass a parameter to a stylesheet" by calling the setParameter() method on the Transformer that is applying the stylesheet.

But when you said your problem involved a custom tag, I assumed (based on absence of any other information) that the custom tag would be the one constructing the Transformer and doing the XSL transformation. If that is the case, then you would have to give the parameters to the custom tag and let it call the setParameter() method.

Is that correct? If so then talk to the person who wrote the tag.

If not, then post your code that is creating a Transformer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing param from request to xsl stylesheet..
 
Similar Threads
Processing Instruction
Unnecessary Tags
detect current URL, referer in XSL???
XSL
tomcat properties