无法验证写入 XML 的 RSS 提要数据(无法识别 'content:encoded' 标签)
Unable to validate RSS feed data in written in XML ('content:encoded' tag not recognized)
我最近建立了自己的博客,并正在为该博客编写 RSS 提要。一旦我得到正确的规则,我打算制作一个脚本来为我做这件事,但现在,我在验证 XML.
时遇到错误
RSS 提要是 here
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/res/preview.xsl"?>
<rss version="2.0">
<channel>
<title>Tuesday's Gone-bholagabbar</title>
<link>http://shreyans-sheth.me/blog/gsoc/home.html</link>
<description><![CDATA[This is bholgabbar's blog, 'Tuesday's Gone'. I (intend to) write about Programming, Algorithms and just about anything under the sun]]></description>
<lastBuildDate>Tue, 26 Apr 2016 20:44:55 GMT</lastBuildDate>
<item>
<title>Hello World!</title>
<link>http://shreyans-sheth.me/blog/home.html</link>
<pubDate>Fri, 26 April 2016 14:34:13 +0000</pubDate>
<description><![CDATA[GSoC '16 #awwwyea']]></description>
<content:encoded><![CDATA[
<p>And finally it's all paid off. Endless IRC conversations, reading code and tutorials I would barely understand at first and all those sleepless nights coding, waiting for mentor replies and the results.</p>
<p>Selected for Google Summer of Code '16 with OpenMRS</p>
]]>
</content:encoded>
</item>
</channel>
</rss>
当我尝试在此处验证 XML 提要时:http://www.feedvalidator.org/check.cgi?url=http%3A%2F%2Fshreyans-sheth.me%2Fblog%2Ftuesdays-gone.xml
你可以检查我得到的错误。我被特别要求在字段和 idk 中包含一个 content 标记,但内容提要中的数据未经过验证并显示在提要中。日期似乎也有问题。可能是什么问题?
您需要declare namespace for content:
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
<channel>
...
</channel>
</rss>
此日期 <pubDate>Fri, 26 April 2016 14:34:13 +0000</pubDate>
的格式应为 <pubDate>Tue, 26 Apr 2016 14:34:13 +0000</pubDate>
。 ('April' => 'Apr' 和 'Fri' => 'Tue' 有效)
进行这些更改后,您的示例提要有效。验证器还建议添加 guid
元素并为 atom:link
添加命名空间
我最近建立了自己的博客,并正在为该博客编写 RSS 提要。一旦我得到正确的规则,我打算制作一个脚本来为我做这件事,但现在,我在验证 XML.
时遇到错误RSS 提要是 here
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/res/preview.xsl"?>
<rss version="2.0">
<channel>
<title>Tuesday's Gone-bholagabbar</title>
<link>http://shreyans-sheth.me/blog/gsoc/home.html</link>
<description><![CDATA[This is bholgabbar's blog, 'Tuesday's Gone'. I (intend to) write about Programming, Algorithms and just about anything under the sun]]></description>
<lastBuildDate>Tue, 26 Apr 2016 20:44:55 GMT</lastBuildDate>
<item>
<title>Hello World!</title>
<link>http://shreyans-sheth.me/blog/home.html</link>
<pubDate>Fri, 26 April 2016 14:34:13 +0000</pubDate>
<description><![CDATA[GSoC '16 #awwwyea']]></description>
<content:encoded><![CDATA[
<p>And finally it's all paid off. Endless IRC conversations, reading code and tutorials I would barely understand at first and all those sleepless nights coding, waiting for mentor replies and the results.</p>
<p>Selected for Google Summer of Code '16 with OpenMRS</p>
]]>
</content:encoded>
</item>
</channel>
</rss>
当我尝试在此处验证 XML 提要时:http://www.feedvalidator.org/check.cgi?url=http%3A%2F%2Fshreyans-sheth.me%2Fblog%2Ftuesdays-gone.xml
你可以检查我得到的错误。我被特别要求在字段和 idk 中包含一个 content 标记,但内容提要中的数据未经过验证并显示在提要中。日期似乎也有问题。可能是什么问题?
您需要declare namespace for content:
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
<channel>
...
</channel>
</rss>
此日期 <pubDate>Fri, 26 April 2016 14:34:13 +0000</pubDate>
的格式应为 <pubDate>Tue, 26 Apr 2016 14:34:13 +0000</pubDate>
。 ('April' => 'Apr' 和 'Fri' => 'Tue' 有效)
进行这些更改后,您的示例提要有效。验证器还建议添加 guid
元素并为 atom:link