xsl-list
[Top] [All Lists]

Re: entity reference...

2003-07-25 02:22:26
Hi Fei,

I have data like this

<teaser>Get more information on &lt;a 
href="http://www.abc.com"&gt;ABC&lt;/a&gt; web site.</teaser>

The output html needs to be this
Get more information on <a href="http://www.abc.com";>ABC</a> web 
site.</teaser>

instead of 
Get more information on &lt;a href="http://www.abc.com"&gt;ABC&lt;/a&gt; web 
site.

You could use the disable-output-escaping attribute on <xsl:value-of>:

  <xsl:value-of select="teaser" disable-output-escaping="yes" />

The disable-output-escaping attribute disables the usual escaping of
the XML-significant characters & and <, instead writing them literally
to the result. Note that disable-output-escaping won't be honoured in
all situations, but you might get lucky.

It would be much better for all concerned if you could persuade
whoever's providing you with this XML to use unescaped, well-formed
HTML within the <teaser> element. Then you would be able to just copy
the contents directly.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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



<Prev in Thread] Current Thread [Next in Thread>