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

1k views Asked by At

I am getting an XML parsing error:

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 &

with the following, the error is with the xhtml:link tag, URL, I tried changing & to & but it won't work.

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

There are 1 answers

0
kjhughes On BEST ANSWER

There is another &utm_medium on the next line that you missed, along with several other & characters that similarly must be changed to &amp;.

Here's your XML with all & properly replaced:

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

The above XML is now well-formed.

Note that there is, at least in your posted XML, and extraneous <xml> open tag at the end of your document.