This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: XSL and inserting values in HTML


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]