This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Access hidden field value in XSL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Access hidden field value in XSL" Watch "Access hidden field value in XSL" New topic

Access hidden field value in XSL

SaurabhSri Sri
Ranch Hand

Joined: May 01, 2008
Posts: 43
Hi All,

I have a hidden field in a XSL.

<input type = 'hidden' name = 'request'>

I just want to use the value of this field inside if condition in XSL -

<xsl:if test="request='abc'"> //Not working. Also $request is not working
<�. Code �>

Thanks a Lot.

SaurabhSri (SCJP 1.5)
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Not sure I follow what you are trying to do. "request" is the value of the name attribute of the input element. You can't use XPath to select a value, you can only select elements and attributes.

We don't know the context of your test (have you already selected the input node?) but this:

will select all input elements which have an attribute called type which has a value of hidden.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: Access hidden field value in XSL
jQuery in Action, 3rd edition