[Home] [By Thread] [By Date] [Recent Entries]
Using xsl 1.0 with php 5.x
I'm trying to consume an atom feed and I'd like to print out the full body of the content. It's wrapped in a CDATA section so I'm having trouble getting it to display correctly. The tags come out escaped despite adding the disable-output-escaping. I've looked via google and not found an answer. Sites do this so it must be possible somehow. Right? Snippets below Links to a manual to read are fine too. Thanks! Joelle My XML snippet (Typical atom feed I'm guessing?) full feed at http://blog.lib.umn.edu/huntx010/ici/atom.xml: <entry> <title>(Further) Reflections on Green Living</title> <link rel="alternate" type="text/html" href="http://blog.lib.umn.edu/huntx010/ici/2008/06/further_reflections_on_green_l.html" /> <link rel="service.edit" type="application/atom+xml" href="https://blog.lib.umn.edu/cgi-bin/mt-atom.cgi/weblog/blog_id=7828/entry_id=131252" title="(Further) Reflections on Green Living" /> <id>tag:blog.lib.umn.edu,2008:/huntx010/ici//7828.131252</id> <published>2008-06-11T19:48:09Z</published> <updated>2008-06-11T19:49:00Z</updated> <summary>Summer is a great time for taking stock of your eco-life, and for adding a little extra oomph to the good habits you already have. For example, are there any "hard-copy" activities you could do online, such as bill paying...</summary> <author><name>Megan Dushin</name></author> <category term="Tips from CEHD Insider" /> <content type="html" xml:lang="en" xml:base="http://blog.lib.umn.edu/huntx010/ici/"> <![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> It generates: <h3><a href="http://blog.lib.umn.edu/huntx010/ici/2008/06/further_reflections_on_green_l.html">(Further) Reflections on Green Living</a>
<span class="feed_posted">Posted on: 06/11/2008</span></h3>
<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>I want (We'll I'd really like to strip out the <br /> tags, but I think I can do that. The part I'm struggling with is the escaping): <h3><a href="http://blog.lib.umn.edu/huntx010/ici/2008/06/further_reflections_on_green_l.html">(Further) Reflections on Green Living</a>
<span class="feed_posted">Posted on: 06/11/2008</span></h3>
<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>
|

Cart



