|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Identifing links in text
Hello Raimund,
it's not necessary to use an extension function, it's possible to do it with a recursive template. The other question is, if it is always the best solution. <xsl:template match="text"> <xsl:call-template name="add-link"> <xsl:with-param name="string" select="."/> </xsl:call-template> </xsl:template> <xsl:template name="add-link"> <xsl:param name="string"/> <xsl:choose> <xsl:when test="contains($string, 'http://')"> <xsl:value-of select="substring-before($string, 'http://')"/> <a href="http://{substring-before(substring-after($string, 'http://'), ' ')}"> <xsl:text>http://</xsl:text> <xsl:value-of select="substring-before(substring-after($string, 'http://'), ' ')"/> </a> <xsl:text> </xsl:text> <xsl:call-template name="add-link"> <xsl:with-param name="string" select="substring-after(substring-after($string, 'http://'), ' ')"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string"/> </xsl:otherwise> </xsl:choose> </xsl:template> I used a single space as end of the link. Regards, Joerg Charles Knell wrote: ---- Raimund Kammering <Raimund.Kammering@xxxxxxx> wrote: XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






