Re: [xsl] Using XSL Variables in HTML Attributes

Subject: Re: [xsl] Using XSL Variables in HTML Attributes
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 12 Jun 2002 15:23:49 -0400
Jesse,

At 01:57 PM 6/12/2002, you wrote:
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>

For this you want to use a handy construction known as "attribute value templates".


Try <option value="{$courseTitle}">...

The brackets in a literal result attribute (also allowed in a few other places) say to the processor "evaluate this and stick the result in". Otherwise '$courseTitle' is taken to be a string like any other (as you no doubt discovered).

Enjoy,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread