[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re:

Subject: Re:
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Mon, 09 Oct 2000 11:52:41 +0100
sumit mishra
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.