[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Setting the value of the HREF attribute
This seems to be a common problem. You need to use the xsl:attribute element. Try: <xsl:template match="participants"> <xsl:for-each select="participant"> <!-- set the HREF attribute to the value of @link --> <!-- this doesn't work: --> <A > <xsl:attribute name = "HREF"><xsl:value-of select="@link"/></xsl:attriubte>click here</A> --> <xsl:apply-templates/> </xsl:for-each> </xsl:template> > -----Original Message----- > From: Nigel Byrnes [SMTP:byrnes@xxxxxxxxxxxxxxxxxxxxxxxx] > Sent: Monday, February 08, 1999 3:13 AM > To: xsl-list@xxxxxxxxxxxxxxxx > Subject: Setting the value of the HREF attribute > > Dear XSL-ers > > To become familiar with XML & XSL, I am in the process of representing a > web site using these technologies. I have just reached a bit of a hurdle > and wondered if you guys could offer some advice.... > > Below is a fragment from a xml document which states Philips Research as > a "participant". I want to use XSL to set produce a HTML page that > includes a link to the Philips Research www site. My problem is that i > don't know how to set the value of the HTML's HREF attribute to the > specified URL. > > I have also included a fragment of the XSL style sheet which is to > format the xml into html. If someone could offer a solution to my > problem, that would be great. > > Thanks > > Nigel > > >>>>> Fragment of XML document > > <?xml version="1.0" encoding="UTF-8"?> > <participants> > <participant link="http://www.research.philips.com">Philips Research > (UK)</participant> > </participants> > > >>>>>>>>> Fragment of XSL Stylesheet > > <xsl:template match="participants"> > <xsl:for-each select="participant"> > <!-- set the HREF attribute to the value of @link --> > <!-- this doesn't work: --> > <!-- <A HREF="<xsl:value-of select="@link"/>">click here</A> --> > <xsl:apply-templates/> > </xsl:for-each> > </xsl:template> > > -- > Nigel Byrnes > > "We continue..." Pete Tong > > Software Engineering and Applications Group, > Philips Research Labs, > Redhill. Tel: +44 (0)1293 815578 > RH1 5HA. Fax: +44 (0)1293 815024 > UK. GSM: +44 (0)7899 940391 > Email: byrnes@xxxxxxxxxxxxxxxxxxxxxxxx > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list 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
|