This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Using XSL Variables in HTML Attributes
- From: "Jesse M. Heines" <heines at cs dot uml dot edu>
- To: <XSL-List at lists dot mulberrytech dot com>
- Date: Wed, 12 Jun 2002 13:57:27 -0400
- Subject: [xsl] Using XSL Variables in HTML Attributes
- Organization: UMass Lowell Computer Science
- Reply-to: xsl-list at lists dot mulberrytech dot com
I have some values stored in XSL variables:
<xsl:variable name="courseNo" select="@crsno" />
<xsl:variable name="courseTitle"
select="//course[@number=$courseNo]/title" />
I can create a dropdown list of course numbers with HTML option tags by
putting the following code inside an appropriate looping structure:
<option>
<xsl:value-of select="$courseNo" />
</option>
I want to use the course titles as the value parameters of the HTML
option tag, but the following doesn't work:
<option value="$courseTitle">
<xsl:value-of select="$courseNo" />
</option>
I have tried various ways to get <xsl:value-of select="$courseTitle" />
inside the quotes for the option value parameter, but nothing I tried
works. I also tried using the XPath string function in a number of ways
to no avail.
I would appreciate suggestions anyone can make on how to accomplish our
goal.
Thank you,
Jesse
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jesse M. Heines, Ed.D.
Associate Professor
Dept. of Computer Science
University of Massachusetts Lowell
Lowell, MA 01854-2881
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list