Why is my sitemap file considered empty?

谁都会走 提交于 2019-12-12 03:09:34

问题


I have a robots.txt file in the root of my site which has this one line in it:

Sitemap: http://www.awardwinnersonly.com/sitemap.xml

The sitemap.xml is also in the root of the site, and contains this text:

<?xml version="1.0" encoding="UTF-8"?>
-<urlset xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://www.awardwinnersonly.com</loc>
    <lastmod>2013-09-16</lastmod>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>http://www.awardwinnersonly.com/getHugos.cshtml</loc>
    <lastmod>2013-09-16</lastmod>
    <changefreq>weekly</changefreq>
    <priority>.7</priority>
    <loc>http://www.awardwinnersonly.com/Content/pulitzers2.json</loc>
    <lastmod>2013-09-16</lastmod>
    <changefreq>monthly</changefreq>
    <priority>.7</priority>
    . . .
      <loc>http://www.awardwinnersonly.com/Content/goldenglobes.json</loc>
      <lastmod>2013-09-16</lastmod>
      <changefreq>monthly</changefreq>
      <priority>.7</priority>
    </url>
</urlset>

Yet, after [re]publishing my site, and trying to navigate to http://www.awardwinnersonly.com/sitemap.xml, I get:

This page contains the following errors:

error on line 2 at column 1: Document is empty
Below is a rendering of the page up to the first error.

(nothing is shown below that - it is more-or-less a "white screen of death.")

What is wrong with either my xml file, robots file, or how I'm going about this?


回答1:


Looks like a stray - got into your file.

$ curl -v http://www.awardwinnersonly.com/sitemap.xml


<?xml version="1.0" encoding="UTF-8"?>
-<urlset xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">


来源:https://stackoverflow.com/questions/18839926/why-is-my-sitemap-file-considered-empty

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!