doujing1156 2010-05-16 14:20
浏览 31
已采纳

这个XML文件对RSS提供是否正确?

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</link>
    <language>es-ES</language>
    <description>Mallas y eso</description>
    <generator>Autor</generator>

     <item>
      <title>Articulo de prueba</title>
      <link>http://www.midominio.com/2342</link>
      <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条回答 默认 最新

  • duanbangzhou7809 2010-05-16 14:30
    关注

    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/">
    

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?