This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re:
- To: Sumit - Mishra <s0m5054 at cs dot tamu dot edu>
- Subject: Re:
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Mon, 09 Oct 2000 11:52:41 +0100
- Cc: XSL-List at mulberrytech dot com
- Reply-To: xsl-list at mulberrytech dot com
Sumit,
>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"
/></xsl:attribute>
</input>
or using an attribute value template -
<input type="hidden" name="empno" value="{empno}" />
I hope that helps,
Jeni
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list