xsl-list
[Top] [All Lists]

[xsl] Display link text as a hyperlink

2008-08-07 08:35:48
Date: Wed, 6 Aug 2008 16:04:28 +0100
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
From: "Andrew Welch" <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com>
Subject: Re: [xsl] Display link text as a hyperlink
Message-ID: 
<74a894af0808060804w7b8319a6h8c4f3934c6f60353(_at_)mail(_dot_)gmail(_dot_)com>

whoooaaaaah there.... you've set off down the wrong road (like so many
others) and it will only end in tears and resentment.  It's completely
the wrong apporach.

To do a search and replace on a string use either replace() or
xsl:analyze-string:

<xsl:analyze-string select="." regex="$the-regex">
  <xsl:matching-substring>
    <a href="http://{.}";>http://<xsl:value-of select="."/></a>
  </xsl:matching-substring>
  <xsl:non-matching-substring>
    <xsl:value-of select="."/>
  </
</

-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

I'm not sure if your code works in XSLT 1.0.  It doesn't appear to work in XSLT 
1.0.  Currently looking into upgrading to XSLT 2.0.  


      


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--