[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Setting the value of the HREF attribute

Subject: RE: Setting the value of the HREF attribute
From: David Schach <davidsch@xxxxxxxxxxxxx>
Date: Mon, 8 Feb 1999 08:59:44 -0800
href a
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.