xsl-list
[Top] [All Lists]

RE: to generate a HOT-LINK in the HTML and FO outputs for all text that matches http://... URL syntax

2003-09-18 10:27:16
Abhishek,

Don't forget, when you do this,

At 05:41 AM 9/18/2003, Jarno wrote:
Write a template for text nodes, which tests if the text contains the string 'http://' and then using XPath string manipulation functions replace the link text with an element that contains the link. Write a recursive one, so that if a single text node contains multiple URLs, all get transformed.

to take account of such cases as http://www.mulberrytech.com/quickrefs. Note the period at the end of that URL is not part of it.

Check out the stuff at exslt.org for hints (they have some nice templates and you might be able to just use em).

Note: this is a classic case of "up-conversion", pushing information up hill, for which XSLT 1.0 was not designed. XSLT 2.0 will have more powerful features for this kind of thing.

This stuff is also well covered by Jeni Tennison's book "XSLT on the Edge". You might want to check it out.

Cheers,
Wendell


___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_
    "Thus I make my own use of the telegraph, without consulting
     the directors, like the sparrows, which I perceive use it
     extensively for a perch." -- Thoreau


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>
  • RE: to generate a HOT-LINK in the HTML and FO outputs for all text that matches http://... URL syntax, Wendell Piez <=