Per said:
Is it possible to use XSLT to automatically create href links while it
formats an XML document? That is, if it finds "
http://me.us/" in a
text, it adds <a href="
http://me.us/">
http://me.us/</a>
Possible, yes. Easy, no.
XSLT doesn't have much in the way of built-in ability to search within
text; it uses XPath, which mostly focuses on document structure.
But XSLT has enough capability that you can build this out of simpler
tools. I don't have an example on hand, but take a look at some of the
string manipulation techniques documented in the XSLT FAQ website
(
http://www.dpawson.co.uk/xsl/xslfaq.html) and they should give you some
ideas on how to approach this. Basically, you can try to use
substring-after() together with some logic to find the URIs, and
recursion in place of iteration to work your way through the source text.
The other solution, if your XSLT implementation allows it, is to call
out to an extension function written in another language. That's going
to be less portable, but may be easier, and depending on the exact
details of your processor and the other language may yield better
performance.
Caveat: Not everything that looks like a URI is intended to be a URI, so
code that tries to add the anchor elements automatically is going to
guess wrong on occasion. As browsers have demonstrated, that usually
isn't fatal... but it's better to have this marked up in the source
document rather than relying on "by guess and by golly."