I'm creating a Sitemap for a website and I noticed that the xml file loaded in a browser is displaying one long line of text instead of the usual pretty printed codes with line breaks.
My expected output would look something like this in these links example 1 and example 2. In case the links are broken, it should look like the image below.
So I am creating a sitemap with alternate languages with the reference of this link from Google.
The xml becomes a one liner text when seen from the browser. Reference image below.
This is the xml code.
<?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>http://rfc.local/en/contact-us/contact-us-success-page</loc>
<xhtml:link rel="alternate" hreflang="zh" href="http://rfc.local/hk/contact-us/contact-us-success-page" />
<xhtml:link rel="alternate" hreflang="en" href="http://rfc.local/en/contact-us/contact-us-success-page" />
<lastmod>2017-07-14</lastmod>
</url>
</urlset>
I've noticed that when I take out the xhtml tags, it then works fine. Is there a way to fix this? Any help would be much appreciated.
I encountered the same problem but I finally found the solution. You must replace http by https in all the urls of the srcset tag :
<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="https://www.w3.org/1999/xhtml">
It should work then.
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With