2016-11-17 2 views
0

Je reçois une erreur: Erreur d'analyse XML:: 88: 805: pas bien formé (jeton non valide) lorsque j'essaie de valider en utilisant https://validator.w3.org/Erreur d'analyse XML: <unknown>: 88: 805: pas bien formé (jeton non valide)

Je suis incapable de trouver la raison de la même chose. Code qui est marqué comme défectueux est donné ci-dessous

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

Répondre

2

Comme l'erreur dit, votre XML est pas bien formé.

Pour corriger ce problème, effectuez les modifications suivantes:

  1. Définir le content utilisé préfixe d'espace de noms.
  2. Supprimez le caractère ^K.
  3. Fermez la section CDATA. Fermez l'élément content:encoded.

Voici votre XML avec les correctifs suivants appliqués:

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

Il est maintenant bien formée.

+0

Bien que mon problème soit différent, la structure que vous avez suggérée m'a beaucoup aidé. Mon problème était que la section CDATA était intégrée dans la balise '. Une séquence char de '--_' qui faisait partie d'une URL rendait le flux RSS invalide bien qu'il se trouvait dans la section CDATA. Quoi qu'il en soit, merci! – helvete