:2:0: unbound prefix"-6ren"> :2:0: unbound prefix"-我正在尝试使用我自己编写的 RSS 提要自行发布我的播客。当我检查它是否在 https://validator.w3.org/feed/ 处验证时我一直在标题中收到错误,它说错误在第 2 行,即 RS-6ren">
gpt4 book ai didi

xml - 播客 RSS 提要中的 "XML parsing error: :2:0: unbound prefix"

转载 作者:行者123 更新时间:2023-12-04 09:25:47 26 4
gpt4 key购买 nike

我正在尝试使用我自己编写的 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">
如果有人能告诉我我做错了什么以及如何修复它以便提要能够验证,我们将不胜感激。
编辑以包含完整代码:

<?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"
在该元素或其祖先处为 nspref命名空间前缀。

在你的情况下
命名空间声明之一中有一个错字:
 xmnls:spotify="https://www.spotify.com/ns/rss"
^^
应该
 xmlns:spotify="https://www.spotify.com/ns/rss"
^^
而且,是的,在解决此类问题后,可能会发现其他问题。

关于xml - 播客 RSS 提要中的 "XML parsing error: <unknown>:2:0: unbound prefix",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63014523/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com