[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Parsing xsl:variable into 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
|
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
|