This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl: help (urgent)
- To: Peter Flynn <peter at silmaril dot ie>
- Subject: Re: [xsl] xsl: help (urgent)
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Tue, 10 Apr 2001 10:34:54 +0100
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <jUsT.aNoTheR.mEsSaGe.iD.98689324529625@silmaril.ie>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Peter,
>>The best thing that you can do is to have the DESCRIPTION element
>>hold HTML rather than a string.
>
> Why not just add a template for the "a" element?
> <xsl:template match="a">
> <a href="{@href}">
> <xsl:apply-templates/>
> </a>
> </xsl:template>
>
> (or a more complex one to handle name as well as or instead of href).
If the HTML was held as HTML, then yes, you could do that, although
simply copying all the nodes within the DESCRIPTION element would
probably be quicker and easier than recursively copying down the tree.
(And if you *do* copy recursively, then it's better to copy attributes
rather than create them with those values; the identity template is
the best method.)
But in Reghu's case, the 'HTML' was a string that happened to look
like a serialisation of HTML rather than actually being HTML - there
were no elements in it to match. So there's no way a template could
have picked up on the 'a element' in it.
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list