I’m trying to do a rss feed in cakephp. I get the xml in the view. So far so good. I can’t figure out how to render the html though, so it looks like http://rss.cnn.com/rss/edition_europe.rss, for example.
I have my controller and the default layout and the view, as the book says, but here i got stuck. I have the html in the description, but it gets outputted as xml, as I said.
Any help much appreciated,
I could be way off the mark here, but you might want to read up on XSL – stylesheets for XML – to see if that might solve the problem:
http://www.w3schools.com/xsl/
http://www.brainbell.com/tutorials/XML/Your_First_XSLT_Style_Sheet.htm
Basically you create another file which ‘transforms’ and styles the XML document (your RSS feed created in CakePHP) to make the browser render it differently.
If you view the source of your CNN example, you can see the following line:
This is the code that makes the browser aware that the XML/RSS document has a stylesheet available to make it nicer to read.