我正在尝试使用自己编写的RSS提要自行发布我的播客。当我检查它是否在https://validator.w3.org/feed/我一直在标题中得到错误,它说错误在第2行,RSS标签本身。我一遍又一遍地检查了代码,并将其与有效的RSS源进行了比较,结果完全相同,所以我不知道问题是什么,w3也没有给我任何解决问题的指示
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:dcterms="http://purl.org/dc/terms/"
xmnls:spotify="https://www.spotify.com/ns/rss"
xmlns:atom="http://www.w3.org/2005/Atom">
如果有人能告诉我我做错了什么,以及如何修复它,以便feed能够验证,我将不胜感激。
编辑以包含完整代码:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:dcterms="http://purl.org/dc/terms/"
xmnls:spotify="https://www.spotify.com/ns/rss"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<!-- Main Information -->
<Title>Entitled Gamers</Title>
<description>Two friends and streamers SamuraiHerc and PoopShizzle get together once a week to chat about what's new and trending in gaming, streaming, and content creating.</description>
<link>https://www.mobomu.com/podcasts/entitledgamers/entitledgamers.html</link>
<image>
<url>https://www.mobomu.com/podcasts/entitledgamers/img/cover.jpg</url>
</image>
<!-- Optional Information -->
<language>en-US</language>
<copyright>Copyright 2020, Mobomu Gaming Network</copyright>
<managingEditor>poopshizzle@mobomu.com</managingEditor>
<webMaster>herc@mobomu.com</webMaster>
<!-- iTunes Specifics -->
<itunes:author>Mobomu</itunes:author>
<itunes:owner>
<itunes:name>Mobomu</itunes:name>
<itunes:email>entitledgamers@mobomu.com</itunes:email>
</itunes:owner>
<itunes:image url="https://www.mobomu.com/podcasts/entitledgamers/img/cover.jpg"/>
<itunes:category text="Leisure">
<itunes:category text="Video Games" />
</itunes:category>
<itunes:category text="Comedy" />
<itunes:category text="News">
<itunes:category text="Entertainment News" />
</itunes:category>
<itunes:summary>Two friends and streamers SamuraiHerc and PoopShizzle get together once a week to chat about what's new and trending in gaming, streaming, and content creating.</itunes:summary>
<itunes:type>episodic</itunes:type>
<!-- Spotify Specifics -->
<spotify::countryOfOrigin>us</spotify::countryOfOrigin>
<!-- Episode 1 -->
<item>
<title>Games are Getting More Expensive?</title>
<enclosure url="https://www.mobomu.com/podcasts/entitledgamers/audio/episode-001.mp3"
length="103132759" type="audio/mpeg"/>
<description>NBA 2K sparks the AAA game price hike conversation. Ninja streams to YouTube without a contract. And Destiny 2's Twitch plugin breaks site-wide subtrain records for big streamers.</description>
<guid>fd63b88b-2714-43c4-9840-d2dc247dda33</guid>
<pubDate>Sun, 12 Jul 2020 14:50:59 GMT</pubDate>
<!-- iTunes Specifics -->
<itunes:duration>42:57</itunes:duration>
<itunes:episodeType>full</itunes:episodeType>
<itunes:episode>1</itunes:episode>
<itunes:season>1</itunes:season>
<itunes:explicit>no</itunes:explicit>
</item>
<!-- Episode 2 -->
<item>
<title>Are Gamers Tired of Battle Royales?</title>
<enclosure url="https://www.mobomu.com/podcasts/entitlegamers/audio/episode-002.mp3"
length="96854827" type="audio.mpeg"/>
<description>Ubisoft's HyperScape is a new Battle Royale game that resurfaces the age-old "gamers are tired of this genre" conversation, but are they really?</description>
<guid>33bdc13a-8c1a-430e-a7c3-709b0d1928e4</guid>
<pubDate>Sun, 19 Jul 2020 17:00:00 GMT</pubDate>
<!-- iTunes Specifics -->
<itunes:duration>40:21</itunes:duration>
<itunes:episodeType>full</itunes:episodeType>
<itunes:episode>2</itunes:episode>
<itunes:season>1</itunes:season>
<itunes:explicit>no</itunes:explicit>
</item>
</channel>
</rss>
编辑2:多亏了下面kjhughes的帮助,我能够解决RSS标签中的错误(这是一个拼写错误(,然后w3能够在我的代码中发现更多的错误,一旦它们都被修复,它就会得到验证。我会发布经过验证的RSS提要代码,供其他可能有类似问题的人参考:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<!-- Main Information -->
<title>Entitled Gamers</title>
<description>Two friends and streamers SamuraiHerc and PoopShizzle get together once a week to chat about what's new and trending in gaming, streaming, and content creating.</description>
<link>https://www.mobomu.com/podcasts/entitledgamers/entitledgamers.html</link>
<image>
<title>Entitled Gamers</title>
<link>https://www.mobomu.com/podcasts/entitledgamers/entitledgamers.html</link>
<url>https://www.mobomu.com/podcasts/entitledgamers/img/cover.jpg</url>
</image>
<atom:link href="https://www.mobomu.com/podcasts/entitledgamers/rss/feed.xml" rel="self" type="application/rss+xml" />
<!-- Optional Information -->
<language>en-US</language>
<copyright>Copyright 2020, Mobomu Gaming Network</copyright>
<managingEditor>poopshizzle@mobomu.com (PoopShizzle)</managingEditor>
<webMaster>herc@mobomu.com (SamuraiHerc)</webMaster>
<!-- iTunes Specifics -->
<itunes:author>Mobomu</itunes:author>
<itunes:owner>
<itunes:name>Mobomu</itunes:name>
<itunes:email>entitledgamers@mobomu.com</itunes:email>
</itunes:owner>
<itunes:image href="https://www.mobomu.com/podcasts/entitledgamers/img/cover.jpg"/>
<itunes:category text="Leisure">
<itunes:category text="Video Games" />
</itunes:category>
<itunes:category text="Comedy" />
<itunes:category text="News">
<itunes:category text="Entertainment News" />
</itunes:category>
<itunes:summary>Two friends and streamers SamuraiHerc and PoopShizzle get together once a week to chat about what's new and trending in gaming, streaming, and content creating.</itunes:summary>
<itunes:type>episodic</itunes:type>
<itunes:explicit>clean</itunes:explicit>
<!-- Episode 1 -->
<item>
<title>Games are Getting More Expensive?</title>
<enclosure url="https://www.mobomu.com/podcasts/entitledgamers/audio/episode-001.mp3"
length="103132759" type="audio/mpeg"/>
<description>NBA 2K sparks the AAA game price hike conversation. Ninja streams to YouTube without a contract. And Destiny 2's Twitch plugin breaks site-wide subtrain records for big streamers.</description>
<guid isPermaLink="false">fd63b88b-2714-43c4-9840-d2dc247dda33</guid>
<pubDate>Sun, 12 Jul 2020 14:50:59 GMT</pubDate>
<!-- iTunes Specifics -->
<itunes:duration>42:57</itunes:duration>
<itunes:episodeType>full</itunes:episodeType>
<itunes:episode>1</itunes:episode>
<itunes:season>1</itunes:season>
</item>
<!-- Episode 2 -->
<item>
<title>Are Gamers Tired of Battle Royales?</title>
<enclosure url="https://www.mobomu.com/podcasts/entitlegamers/audio/episode-002.mp3"
length="96854827" type="audio/mpeg"/>
<description>Ubisoft's HyperScape is a new Battle Royale game that resurfaces the age-old "gamers are tired of this genre" conversation, but are they really?</description>
<guid isPermaLink="false">33bdc13a-8c1a-430e-a7c3-709b0d1928e4</guid>
<pubDate>Sun, 19 Jul 2020 17:00:00 GMT</pubDate>
<!-- iTunes Specifics -->
<itunes:duration>40:21</itunes:duration>
<itunes:episodeType>full</itunes:episodeType>
<itunes:episode>2</itunes:episode>
<itunes:season>1</itunes:season>
</item>
</channel>
</rss>
一般
必须声明所有以使用为前缀的XML命名空间。
具体来说,文档中的每个XML元素名称都带有表单
nspref:LocalName
必须像这个一样声明
xmlns:nspref="http://example.com/ns"
在该元素或其祖先处用于CCD_ 1名称空间前缀。
在您的情况下
其中一个名称空间声明中有一个拼写错误:
xmnls:spotify="https://www.spotify.com/ns/rss"
^^
应该是
xmlns:spotify="https://www.spotify.com/ns/rss"
^^
是的,在解决了这样一个问题之后,其他问题可能会被发现。