"XML parsing error: <unknown>:2:0: unbound prefix" in Podcast RSS feed

"XML parsing error: <unknown>:2:0: unbound prefix" in Podcast RSS feed

我正在尝试 self-publish 我的播客使用我自己编写的 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 能够在我的代码中找到更多的错误,一旦他们都已修复,已验证。我将 post 经过验证的 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"

nspref 命名空间前缀的那个元素或其祖先。


你的情况

其中一个命名空间声明中存在拼写错误:

 xmnls:spotify="https://www.spotify.com/ns/rss"
   ^^

应该是

 xmlns:spotify="https://www.spotify.com/ns/rss"
   ^^

而且,是的,在解决了这样一个问题之后,其他人可能会被发现。