This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Passing javascript value to XSL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Passing javascript value to XSL" Watch "Passing javascript value to XSL" New topic

Passing javascript value to XSL

Raymond Villeno
Ranch Hand

Joined: Jun 21, 2005
Posts: 63
Hi, Let say I have a variable in javascript

and I need to use that value in an xsl block let say an if conditional block, my question is, is there a way so that I can pass that parameter to an xsl block?

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

I don't think so for 2 reasons.

1) If you are processing the XSL on the server side, it doesn't have access to any javascript you have included on the page since that is processed on the client side.

2) If you are letting the browser handle the XSL (bad idea) I *think* the XSL parser runs first and then the Javascript, hence no way to get the javascript variable back into the XSL.

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: Passing javascript value to XSL
jQuery in Action, 3rd edition