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

RE: How to create hyperlinks using XSL or XML files

Subject: RE: How to create hyperlinks using XSL or XML files
From: "Steve Gold" <Steve@xxxxxxxxxxxxx>
Date: Thu, 12 Dec 2002 20:05:12 -0500
hyperlinks xsl
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:  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


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.