This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: xsl: help (urgent)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]