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

Display link text as a hyperlink

Subject: Display link text as a hyperlink
From: Brent Solly <ultra@xxxxxxxxx>
Date: Wed, 6 Aug 2008 07:45:54 -0700 (PDT)
 Display link text as a hyperlink
I have an xml file that contains this character sequence: 'www.gamefaqs.com' .

Primary Problem:
After I convert the 'www' text to hyperlink format, the xsl displays it as plain text, but I would like to display it has a hyperlink.   

I am aware that the url may also contain subfolders like: www.gamefaqs.com/console/n64   OR different a suffix like www.gamefaqs.ca., but right now I'll focus on .com, but feel free to make suggestions :) . 

<?xml version="1.0" encoding="UTF-8"?>
         <description>More information on this game can be found at (www.gamefaqs.com)</description>

<?xml version="1.0" encoding="UTF-8"?>

<xsl:strip-space elements="*" />
<xsl:output method="html" encoding="UTF-8"/>

<xsl:template name="globalReplace">
  <xsl:param name="outputString"/>
  <xsl:param name="target"/>
  <xsl:param name="replacement"/>
   <!--Begin Test -->
   <xsl:when test="contains($outputString,$target)">
      <xsl:value-of select=
      <xsl:call-template name="globalReplace">
        <xsl:with-param name="outputString" 
        <xsl:with-param name="target" select="$target"/>
        <xsl:with-param name="replacement" 
   <!--End Test-->
      <xsl:value-of select="$outputString"/>

<xsl:template match="rss">
  <xsl:call-template name="globalReplace">
  <xsl:with-param name="outputString" select="."/>
  <xsl:with-param name="target" select="'www'"/>
  <xsl:with-param name="replacement" select="concat('&lt;a href=&#34;http://www',substring-before(substring-after(.,'www'),substring-after(.,'com')),'&#34;&gt;',substring-before(substring-after(.,'www.'),'.com'),'&lt;/a&gt;')"/>


Current Thread


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.
First Name
Last Name
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.