无法解析任何 XML 输入。第 5 行错误:对实体 "utm_medium" 的引用

Unable to parse any XML input. Error on line 5: The reference to entity "utm_medium"

我收到 XML 解析错误:

Unable to parse any XML input. Error on line 5: The reference to entity utm_medium must end with the ; delimiter. You most likely forgot to escape & into &

下面的,错误是xhtml:link标签,URL,我试过把&改成&,但是不行。

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
   <url>
      <loc>https://www.com/financing/?utm_source=website&amp;utm_medium=banner&amp;utm_campaign=YBF&amp;utm_id=Yellow+Bar+Financing</loc>
      <xhtml:link rel="alternate" hreflang="en" href="https://www..com/financing/?utm_source=website&utm_medium=banner&utm_campaign=YBF&utm_id=Yellow+Bar+Financing" />
      <lastmod>20015-04-01</lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.5</priority>
   </url>
</urlset>
<xml>

您错过的下一行还有另一个 &utm_medium,以及其他几个 & 字符,同样必须更改为 &amp;

这是您的 XML,所有 & 已正确替换:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://www.com/financing/?utm_source=website&amp;utm_medium=banner&amp;utm_campaign=YBF&amp;utm_id=Yellow+Bar+Financing</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://www..com/financing/?utm_source=website&amp;utm_medium=banner&amp;utm_campaign=YBF&amp;utm_id=Yellow+Bar+Financing" />
    <lastmod>20015-04-01</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.5</priority>
  </url>
</urlset>

上面的XML现在是well-formed.

请注意,至少在您发布的 XML 中,在文档末尾有无关的 <xml> 打开标签。