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:

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

(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    | left mind gets pretty crowded." 
XML Q&A:     | (Steven Wright)

 XSL-List info and archive:

Current Thread