tags:

views:

38

answers:

1

Hi guys

I am generating a XML-RSS type file from PHP.

The output for example is like this

<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
 <channel>
    <title>Mi web mola</title>
    <link>http://www.dominio.com/blog.php&lt;/link&gt;
    <language>es-ES</language>
    <description>Mallas y eso</description>
    <generator>Autor</generator>

     <item>
      <title>Articulo de prueba</title>
      <link>http://www.midominio.com/2342&lt;/link&gt;
      <pubDate>14/06/2010</pubDate>
      <description><![CDATA[Descripcion de prueba bla bla bla]]></description>
      <content:encoded><![CDATA[Contenido prueba]]></content:encoded>
     </item>

 </channel>
</rss> 

... and all I can see in the Firefox preview is the title and the description of the blog, not the items, but in the source it appears correctly, so I've thought it must be a parse error or something like that..

What could be wrong?

Again, excuse me for my bad english, and thank you very much.

+1  A: 

I don't know if this is your RSS problem, but as it stands that isn't valid XML-with-namespaces.

If you want to use a <content:encoded> element, you should declare a namespace for the prefix content.

<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"&gt;

Also pubDate should be in RFC822 format, eg. Mon, 14 Jun 2010 12:00:00 GMT.

bobince
thanks!! that was it!! anyway i'll make a note of what bobince said, but it's already working.
Hermet
ehm.. i have just realized that YOU are bobince, the same who commented about questionable use of CDATA sections.. sorry :-|
Hermet