xsl-list
[Top] [All Lists]

Re: [xsl] Printing CDATA from feed as HTML

2008-06-13 01:04:52
      <![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/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--