RE: [xsl] How to create hyperlinks using XSL or XML files

Subject: RE: [xsl] How to create hyperlinks using XSL or XML files
From: "Mick Storm" <mstorm@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Dec 2002 17:15:49 -0800
Why not save yourself some time and forget about the variable. just
write:


<!--  Put the contents of the variable into the HTML -->

<a href="{@URL}">Put link text here</a>


Mick Storm
Archetype Solutions, Inc.
Emeryville, CA. 94608

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Steve Gold
Sent: Thursday, December 12, 2002 5:05 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] How to create hyperlinks using XSL or XML files


How about doing it this way also:

<!--	Set a variable to hold the href link -->
<xsl:variable name="href"><xsl:value-of select="@URL"></xsl:variable>

<!--  Put the contents of the variable into the HTML -->
<a href="{$href}">Put link text here</a>


Just for fun, I have included a similar code snip below which puts a
value into the hyperlink as a part of the query string for when you want
custom hyperlinks:
- <xsl:variable name="unit_id">
  <xsl:value-of select="UNIT_ID" /> 
  </xsl:variable>
- <a href="homepage_web.html?{$unit_id}">
  <xsl:value-of select="UNIT_NAME" /> 
  </a>

Enjoy,

            Steve

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Neil Smith
Sent: Thursday, December 12, 2002 3:43 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Cc: Stephanie_M._Watson@xxxxxxxxxxxxxx
Subject: Re: [xsl] How to create hyperlinks using XSL or XML files


Just been working with this today :

In your xsl, try :

<a>
         <xsl:attribute name="href">
                 <xsl:value-of select="@URL">
         </xsl:attribute>
         <xsl:value-of select="@URL">
</a>

This will insert href="@URL" (ie, the value of URL) into your anchor tag
in 
the output, then URL will be (again) inserted between your anchor tags
as text.

HTH
Neil Smith.

At 14:44 12/12/2002 -0500, you wrote:

>
>I want to display the URLs that I have declared in the XML document as 
>URL="http://..."; as hyperlinks on the web.  Currently, the output from
my 
>stylesheet looks like this in Internet Explorer:

><snip/>

>I'm thinking that I have to work with the XSL file, but so far, I only
>see
>a way to hyperlink a single URL in the stylesheet  -- so that the one 
>hyperlinked URL is used in every listing in the XML document.
>
>Here's the relevant part of my XSLT file  (the URL section).  This
>simply
>displays the web address when the XML file is viewed on IE.  The
address 
>is not an active hyperlink.
>
><xsl:for-each select="@URL">
><span style="font-family:Arial">
><xsl:value-of select=""/>
></span>
></xsl:for-each>
>
>Any ideas on how to resolve this are greatly appreciated.
>
>Thank you.
>
>Stephanie Watson
>Unversity of Maine
>
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


========================================================
VideoChat with friends online, get Freshly Toasted every
day at http://www.fresh-toast.net : NetMeeting solutions
for a connected world.



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


 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