[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl: help (urgent)

Subject: Re: xsl: help (urgent)
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 10 Apr 2001 10:34:54 +0100
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.