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

RE: Parsing xsl:variable into HTML

Subject: RE: Parsing xsl:variable into HTML
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 2 Jul 2003 15:31:28 +0100
variable in html
> 
> How can I pass the value of a xsl:variable into the id of a checkbox?
> 
> My code looks like this:
> 
> <xsl:variable name="CB_ID">
>      <xsl:value-of select = "ID"/>
> </xsl:variable> 
> 
> ....
> 
> <input type="checkbox" id="?????" onclick=""/>
> 
> ???? What do I need to fill in here to get the value of the 
> variable CB_ID?
> 

Write input type="checkbox" id="{$CB_ID}" onclick=""/>

It's called an "attribute value template" which should help you to look
it up in your favourite XSLT book.

By the way, try to get out of the habit of writing

> <xsl:variable name="CB_ID">
>      <xsl:value-of select = "ID"/>
> </xsl:variable> 

when you could write

<xsl:variable name="CB_ID" select="ID"/>

This might seem a cosmetic difference, but you're putting the XSLT
processor to a lot of trouble to construct a tree, or to work out that
you don't actually need one, when all that you need is a string.

Michael Kay


 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.