2016-11-17 118 views
0

我收到錯誤消息:XML解析錯誤:88:805:格式不正確(無效標記)當我嘗試使用https://validator.w3.org/XML解析錯誤:<unknown>:88:805:格式不正確(無效令牌)

我無法找到相同的原因。下面

<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> 

回答

2

是給出其被標記爲有缺陷的 代碼錯誤說,不能很好地形成的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> 

它現在形成良好。

+0

雖然我的問題不同,但您建議的結構對我有很大的幫助。我的問題是CDATA節嵌入在<! - description>標籤中。作爲URL的一部分的「 - _」的字符序列使得RSS提要無效,儘管它位於CDATA部分內。不管怎樣,謝謝! – helvete

相關問題