Re: [xsl] Printing CDATA from feed as HTML

Subject: Re: [xsl] Printing CDATA from feed as HTML
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 13 Jun 2008 09:04:22 +0100
>       <![CDATA[<p>Summer is a great time for taking stock of your<br />
>     eco-life, and for adding a little extra oomph to the good habits<br />
>     you already have. For example, are there any "hard-copy"<br />
>     activities you could do online, such as bill paying or travel<br />
>     planning? Do you need multiple light sources in your office, or<br />
>     would one do the job? Could you take mass transit to work two days<br />
>     a week instead of just one? Take time to ask reflective questions<br />
>     such as these--the Earth will thank you for it!</p>]]>
>         </content>
> </entry>
>
> My xsl snippet:
>
>
>   <xsl:template match="atom:entry[position() = 1]">
>       <h3>
>           <xsl:apply-templates select="atom:title"/>
>           <xsl:text>
>           </xsl:text>
>           <span class="feed_posted">Posted on:
>               <xsl:apply-templates select="atom:updated"/></span>
>       </h3>
>             <xsl:value-of disable-output-escapting="yes"
> select="atom:content"/>
>   </xsl:template>

You need to parse the cdata section using an extension such as
saxon:parse(), then you can use the identity template and a no-op
template to filter out the <br/>'s

I think a parse() function almost made it into 2.0...

-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread