Subject: Re: [xsl] Identifing links in text From: Joerg Heinicke <joerg.heinicke@xxxxxx> Date: Tue, 04 Jun 2002 21:41:30 +0200 |
---- Raimund Kammering <Raimund.Kammering@xxxxxxx> wrote:
Hallo Everybody,
I need some way to identify a link like statement in a tagged piece of text. To make it more clear here is a small sample the XML code migth look like:
<entry> <keyword>Info</keyword> <text>Some amount of plain text. But inside may appear a statement like this: http://www.some-server.com and this shall be shown as a usual (blue) link in a browser.</text> <entry>
You've identified one of XSLT's weaknesses. You will most likely have to write an extension function incorporating regular expression processing so you will be able to find and wrap the links with the <a href=""></a> tags.
I believe that most processors provide a means of extending xsl's built-in functions. I know that you can write JavaScript extensions for MSXML (because I've done it) and that Oracle's processor supports extension functions written in Java (because I've researched, but not written any).
It is only with the most recent version of Java (J2SE 1.4 ?) that a standard API for regular expression processing has been included. JavaScript has very good regular expression capabilities, so if you are using MSXML, you will probably not have too much trouble in writing the function.
If you're willing to "think outside the box" for this, you could easily write a Perl script to pre-process this file before it gets sent to the XSL processor.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Identifing links in text, Charles Knell | Thread | RE: [xsl] Identifing links in text, Andrew Welch |
Re: [xsl] Escaping newlines in an X, Thomas B. Passin | Date | Re: [xsl] Elements of non-actual po, Joerg Heinicke |
Month |