I have an XML Sitemap that needs to be rendered properly when accessed on a browser.
See code below.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<urlset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
>
<url>
<loc>https://www.brideonline.ru/_____PassioanteLady.html</loc>
<xhtml:link rel="alternate" hreflang="ru-us" href="https://www.brideonline.ru/profile.php?Language=Russian&ID=_____PassioanteLady&Language1=1"/>
<changefreq>monthly</changefreq>
<priority>0.1</priority>
</url>
<url>
<loc>https://www.brideonline.ru/___Alisa___.html</loc>
<xhtml:link rel="alternate" hreflang="ru-us" href="https://www.brideonline.ru/profile.php?Language=Russian&ID=___Alisa___&Language1=1"/>
<changefreq>monthly</changefreq>
<priority>0.1</priority>
</url>
</urlset>
However, when I try accessing it on a browser, it only shows as plain text.
Any help/explanation why it renders as plain text is very much appreciated.
Thank you.
So after many hours of googling and doing a lot of trial and errors, I managed to fix my problem with the help of this link: Google multilingual sitemap issue
By changing the declaration from this (using http://www.w3.org/1999/xhtml):
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
to this (using http://www.w3.org/TR/xhtml11/xhtml11_schema.html):
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.w3.org/TR/xhtml11/xhtml11_schema.html http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/TR/xhtml11/xhtml11_schema.html">
Now when the XML file is accessed on the browser, it now returns XML format and not plain text.
Hope this may help others in need. :)
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