|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re:
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








