Re: XSL and inserting values in HTML

Subject: Re: XSL and inserting values in HTML
From: "John E. Simpson" <simpson@xxxxxxxxxxx>
Date: Thu, 26 Oct 2000 14:28:49 -0700
Henrik Andersson wrote:
> I now wonder how I can build
> a link that looks like this.
> 
> agenda.asp?action=del;amp&id=2
> 
> where the number 2 is coming from the XML.
> 
> I have tried the following but it don?´t work.
> <a href="agenda.asp?action=del;amp&id= <xsl:value-of select="ID" />
> >click</a>

Right -- you can't put markup inside an attribute value. What you're
after is the <xsl:attribute> element, which lets you construct attribute
"content" (i.e. value) using arbitrary content otherwise available to
the stylesheet. In your case, you'd do something like:

   <a><xsl:attribute
name="href">agenda.asp?action=del;amp&id=<xsl:value-of select="ID"
/></xsl:attribute>click</a>

(If you're using the MSXML processor, Sept. '00 release, be careful not
to allow any newlines into the attribute value when you do this. There's
a known bug which will probably be taken care of in the next release.)

================================================================
John E. Simpson          | "When I'm not in my right mind, my 
http://www.flixml.org    | left mind gets pretty crowded." 
XML Q&A: www.xml.com     | (Steven Wright)


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


Current Thread