Subject: Re:
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Mon, 09 Oct 2000 11:52:41 +0100

>Now as one does in html:
><td><xsl:value-of select="empno"/>
>            <input type="hidden" name="empno" value="empno"></input></td>
>I am not being able to do the same with xsl as the value being passed to
>the servlet is the string "empno" and not the value of attribute "empno"
>how do i perform this action

If you have the above HTML in your stylesheet, then that's what you get in
your result HTML, i.e. the output will hold:

  <input type="hidden" name="empno" value="empno" />

and therefore the field 'empno' will always return the value 'empno'.  You
want to insert the value of the 'empno' element in your source XML as the
value of the 'value' attribute on the 'input' element that you're creating.
 In other words, you want the value of an attribute in the result to be
chosen based on a value in the source.

You can do this in two ways: using an xsl:attribute -

  <input type="hidden" name="empno">
    <xsl:attribute name="value"><xsl:value-of select="empno"

or using an attribute value template -

  <input type="hidden" name="empno" value="{empno}" />

I hope that helps,


Jeni Tennison

 XSL-List info and archive:

Current Thread