开发者

  makes RSS feed fail validation

开发者 https://www.devze.com 2023-03-30 11:46 出处:网络
Im making an RSS feed from content that\'s been imported into my site. The content contains  , which makes the RSS feed fail validation. I\'m trying to strip out the   but I\'m not s

Im making an RSS feed from content that's been imported into my site. The content contains  , which makes the RSS feed fail validation. I'm trying to strip out the   but I'm not sure ill be able to. The feed looks fine in google read开发者_JAVA技巧er but IE's reader just displays an error.

Are their any other solutions to my problem? Could I make the doc type less strict or something similar?

Thanks


You shouldn't need   at all if the content will be visible in an rss feed. If you're using PHP to generate the feed, you can use str_replace to strip it.

$stripped = str_replace(" ", " ", $original);

So if you're iterating thru a loop, $original will be the var with the original data, when outputting the data, use $stripped instead. It will replace the $nbsp; with a single space.


You could replace all   entities with  .

0

精彩评论

暂无评论...
验证码 换一张
取 消