I use the R Studio > Blogdown > Github > Netlify chain to publish my website https://whatbank.ca
I am trying to add a sitemap.xml file by placing it in layouts/sitemap.xml
When I point Chrome to whatbank.ca/sitemap.xml I get the error:
When I view source I see:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
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">
<url>
<loc>https://www.whatbank.ca/</loc>
<lastmod>2021-03-25T13:24:33+00:00</lastmod>
</url>
</urlset>
Yet the source on Github looks like:
<? xml version="1.0" encoding="UTF-8" ?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
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">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->
<url>
<loc>https://www.whatbank.ca/</loc>
<lastmod>2021-03-25T13:24:33+00:00</lastmod>
</url>
</urlset>
I’m suspicious of the second line on the live version of sitemap.xml
<?xml version="1.0" encoding="UTF-8"?>
Is that the reason why my browser ignores the XML file?
Why is this happening?