【问题标题】:XML parsing error: <unknown>:88:805: not well-formed (invalid token)XML 解析错误:<unknown>:88:805: not well-formed (invalid token)
【发布时间】:2016-11-17 16:15:03
【问题描述】:

当我尝试使用https://validator.w3.org/ 进行验证时出现错误:XML 解析错误::88:805: not well-formed (invalid token)

我找不到相同的原因。 标记为有缺陷的代码如下所示

<content:encoded><![CDATA[<p>It&rsquo;s a pleasure to share some of the recipes in <a href="https://www.example.com/abc-dss-Life-as-Radiant-Boundless/dp/0814437079/ref=sr_1_1?ie=UTF8&amp;qid=1467207110&amp;sr=8-1&amp;keywords=a+plant+based+life"><em>A ad-as</em></a>with you! I finished perfecting this recipe the week that NASA&rsquo;s Kepler Mission found a new Earth-like planet, 452b, so I named it in honor of the discovery. If I were an astronaut on a years-long space mission and could only bring one food with me, this lasagna would definitely be a top contender. Other great features of this recipe? Neither the noodles nor the filling need to be precooked&mdash;after some quick chopping, which you can do in a food processor, this dish will be ready to pop in the oven.For the full sampler of recipes with delicious images, <a href="http://www.example.net/abc/a-abc-abc-abc-abc" target="_blank">click here to see the slideshow</a>. <strong>Ingredients: </strong></p>

【问题讨论】:

    标签: xml wordpress feed


    【解决方案1】:

    正如错误所说,您的 XML 格式不正确。

    要修复它,请进行以下更改:

    1. 定义使用的content 命名空间前缀。
    2. 删除^K 字符。
    3. 关闭 CDATA 部分。
    4. 关闭content:encoded 元素。

    这是应用了以下修复的 XML:

    <content:encoded xmlns:content="http://example.com/content">
      <![CDATA[<p>It&rsquo;s a pleasure to share some of the recipes in <a
      href="https://www.example.com/abc-dss-Life-as-Radiant-Boundless/dp/0814437079/ref=sr_1_1?ie=UTF8&amp;qid=1467207110&amp;sr=8-1&amp;keywords=a+plant+based+life">
      <em>A ad-as</em> </a>with you! I finished perfecting this recipe the
      week that NASA&rsquo;s Kepler Mission found a new Earth-like planet,
      452b, so I named it in honor of the discovery. If I were an
      astronaut on a years-long space mission and could only bring one
      food with me, this lasagna would definitely be a top
      contender. Other great features of this recipe? Neither the noodles
      nor the filling need to be precooked&mdash;after some quick
      chopping, which you can do in a food processor, this dish will be
      ready to pop in the oven.For the full sampler of recipes with
      delicious images, <a
      href="http://www.example.net/abc/a-abc-abc-abc-abc"
      target="_blank">click here to see the
      slideshow</a>. <strong>Ingredients: </strong> </p>]]>
    </content:encoded>
    

    现在格式正确。

    【讨论】:

    • 虽然我的问题有所不同,但您建议的结构对我帮助很大。我的问题是 CDATA 部分嵌入在 &lt;!--description&gt;&lt;desctiption--&gt; 标签中。作为 URL 一部分的 --_ 字符序列使 RSS 提要无效,尽管它位于 CDATA 部分中。无论如何,谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-26
    • 2012-10-14
    • 1970-01-01
    • 2015-05-16
    • 1970-01-01
    相关资源
    最近更新 更多