前几天提交了一个Google sitemap,今天查看的时候,显示了如下内容:

日期无效
发现无效日期。请修正日期或格式,然后重新提交。
父标记:
标记:
值:
检测到问题的日期:
url
lastmod
2009-05-25 12:33:02
2009-5-24

看了一下Google的帮助说明里边的sitemap常见错误:
压缩错误

Google 在尝试对压缩的 Sitemap 文件进行解压缩时出现了错误。请重新压缩您的 Sitemap(使用诸如 gzip 的工具),然后将其上传到您的网站,再重新提交。

Sitemap 为空

Google 已下载了您的 Sitemap,但其中未包含任何网址。请检查您的 Sitemap,确保其不为空。如果您的 Sitemap 使用的是 Google Sitemap 协议,请对其进行验证以确保对网址作了正确标记。然后重新提交您的 Sitemap。

属性值无效

Google Sitemaps 支持的唯一一种包含属性值的文件类型为联合供稿。例如,在以下 Atom 供稿代码片段中,href 为一种属性。

例如,如果将 href 属性设置为以下值,您将看到此错误:href="htp:/www.example.com/索引.html"

 

修正此值后,请重新提交您的 Sitemap。
日期无效

您的 Sitemap 包含一个或多个无效的日期。这可能是因为日期格式错误或日期本身无效。日期需要使用 W3C Datetime 编码,但您可以忽略时间部分。例如,以下两个示例均为有效日期:

  • 2005-02-21
  • 2005-02-21T18:00:15+00:00

如果日期仅指定了时间但未指定时区,那么,即使日期的格式正确,也可能无效。未指定时间的日期是有效的(设置默认时间为 00:00:00Z)。

标记值无效

标记是一种 XML 元素。例如,在以下代码片段中, 为一标记。

http://www.example.com/
2005-01-01
monthly
0.8
 

 

标记的值指的是起始标记与结束标记之间的内容。在此示例中,http://www.example.com/ 是起始标记 和结束标记 之间的内容,因此,它是 标记的值。

如果您看到此错误消息,那么,这表示您的 Sitemap 中包含带有无效值的标记。错误消息中会列出标记及其所在的行号。有关 Sitemap 协议中有效标记值的详细信息,请参阅协议文档。修正此值后,请重新提交您的 Sitemap。

网址无效

所列出的网址无效。请更正 Sitemap 中的网址,然后重新提交。

确保您 Sitemap 中所列出的网址已经过编码,以便可以进行识别和正确转义。您也可以尝试将网址复制到浏览器中,以检查浏览器是否能够识别网址并加载网页。

确保网址中未包含额外的字符(例如确保网址没有加引号)。

网址无效:我们检测到您所列出的 Sitemap 未包含完整的网址。

Sitemap 索引文件会列出 Sitemap。您应当使用完整的网址列出每个 Sitemap(例如 http://www.example.com/sitemap.xml)。如果您只使用文件名(例如 sitemap.xml)列出 Sitemap,那么,您会遇到此错误。

我们会尝试从 Sitemap 索引文件所在的同一目录中检索该 Sitemap。例如,如果您的 Sitemap 索引文件位于 http://www.example.com/文件夹 1/sitemap 索引.xml,并且,您将某一 Sitemap 作为 sitemap.xml 列出,那么,我们会在 http://www.example.com/文件夹 1/sitemap.xml 上尝试检索该 Sitemap。如果我们在此网址中找不到该 Sitemap,那么,您会看到此次尝试的错误消息。

XML 无效:标记过多

标记是一种 XML 元素。例如,在以下代码片段中, 为一标记。
http://www.example.com/
2005-01-01
monthly
0.8

 

 

如果您看到此错误消息,那么,这表示您的 Sitemap 中包含重复的标记。例如,以下原因可能会导致出现此错误(由于 标记被列出过两次):
http://www.example.com/
http://www.example.com/page1.html
2005-01-01
monthly
0.8

 

错误消息中会列出标记及其所在的行号。修正此重复错误后,请重新提交您的 Sitemap。

XML 属性缺失

Google Sitemaps 支持的唯一一种包含属性值的文件类型为联合供稿。例如,在一下代码片段中, 为一种属性。

例如,如果 href 属性缺失,您将会看到此错误消息。添加了属性并赋予其有效的值后,请重新提交您的 Sitemap。

XML 标记缺失

标记是一种 XML 元素。例如,在以下代码片段中, 为一标记。
http://www.example.com/
2005-01-01
monthly
0.8

 

如果您的 Sitemap 文件缺少必要的标记,那么,您可能会看到此错误消息。例如,在以下代码片段中, 标记缺失,并会引发此错误。
2005-01-01
monthly
0.8

 

请记下所列出的行号并参阅 协议文档来了解所需标记的详细信息。修正 Sitemap 后,请重新提交。

嵌套索引

您的 Sitemap 索引列出了自身的网址或其他 Sitemap 索引的网址。一个 Sitemap 索引文件是无法列出其他 Sitemap 索引文件的。

解析错误

Google 在 Sitemap 中检测到了 XML 解析错误。有关 XML 验证的详细信息,请参阅验证您的 Sitemap。

临时错误

我们的系统遇到了一个临时性问题。通常,出现此错误时,您无需重新提交您的 Sitemap。Google 稍后会尝试再次检索您的 Sitemap。请稍后再返回查看检索是否成功。如果几个小时后此错误仍然存在,那么,您可以重新提交您的 Sitemap。

Sitemap 过多

您 Sitemap 索引中的 Sitemap 列表超出了允许的最大数量。一个 Sitemap 索引最多可包含 1,000 个 Sitemap。请将您的 Sitemap 索引拆分为多个 Sitemap 索引文件,并确保每个 Sitemap 索引文件所包含的 Sitemap 数量不超过 1,000 个。然后,分别重新提交每个 Sitemap 索引文件。

网址过多

您 Sitemap 中的网址列表超出了允许的最大数量。一个 Sitemap 最多可包含 50,000 个网址。请将您的 Sitemap 拆分为多个 Sitemap,并确保每个 Sitemap 所包含的网址数量不超过 50,000 个。您也可以使用 Sitemap 索引来管理自己的 Sitemap。然后,请分别提交您的 Sitemap 索引或 Sitemap 文件。

文件格式不受支持

您的 Sitemap 格式可能不受支持。请确保您的 Sitemap 格式符合 Sitemap 指南的要求,然后重新提交。

可检查以下内容:

  • 文件使用的标头是否正确。Sitemap 文件的标头应为以下格式:

    Sitemap 索引文件的标头应为以下格式:
    xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  • 标头中的命名空间应为:"http://www.sitemaps.org/schemas/sitemap/0.9"。请注意,结尾必须为 0.9。如果结尾是 .9,那么,系统将会显示错误消息。

     

  • 每个 XML 属性都被单引号 (') 或双引号中 (") 引出,并且,引号为直引号,而不是弯引号。如果您使用文字处理程序(例如 Microsoft Word),您可能会发现,该程序插入的是弯引号。
不允许的网址

Google 检测到某些网址位于比 Sitemap 文件存储位置更高一级的目录或不同的域名中。如果出现此错误,请尝试将您的 Sitemap 文件移至您网站中更高一级的目录中,然后再次提交。例如,如果您的 Sitemap 被列在 http://www.example.com/我的网站/sitemap.xml 下,那么,以下网址对此 Sitemap 无效:

  • http://www.example.com/ - 该网址位于比 Sitemap 存储位置更高一级的目录中
  • http://www.example.com/您的网站/ - 该网址位于与 Sitemap 存储位置同一级的目录中

您还应当检查所有的网址是否均以与 Sitemap 存储位置相同的域名开头。例如,如果您的 Sitemap 被列在 http://www.example.com/sitemap.xml 下,那么,以下网址对此 Sitemap 无效:

  • http://www.google.com - 该网址位于 google.com 域而非 example.com 域中
  • http://example.com/ - 该网址缺少起始的 www
  • www.example.com/ - 该网址缺少协议 (http)
  • https://www.example.com/ - 该网址使用了不同的协议(https 而非 http)

Sitemap 中的任何未被拒绝的网址通常都会得到处理。

路径不符:我们检测到您使用了未包含 www 前缀的网址路径提交 Sitemap。

我们检测到您使用了未包含 www 前缀(例如 http://example.com/sitemap.xml)的网址路径提交 Sitemap。但您 Sitemap 中所列出的网址却使用了 www 前缀(例如 http://www.example.com/我的文件.htm)。

要修正此问题,您应当决定您希望 Google 以何种方式来将您网站中的网址编入索引。

如果您希望 Google 使用 www 前缀将您网站中的网址编入索引,那么,您应当从您的 Google Sitemaps 帐户中删除 Sitemap,并使用带有 www 前缀的路径(例如 http://www.example.com/sitemap.xml)重新提交您的 Sitemap。如果选择这种方式,那么,您不需要修改您 Sitemap 中的网址。

如果您不希望 Google 使用 www 前缀将您网站中的网址编入索引,那么,您应当修改您的 Sitemap,并删除其中所列出的网址的 www 前缀,然后重新提交 Sitemap。

路径不符:我们检测到您使用了包含 www 前缀的网址路径提交 Sitemap。

我们检测到您使用了包含 www 前缀(例如 http://www.example.com/sitemap.xml)的网址路径提交 Sitemap。但您 Sitemap 中所列出的网址却未使用 www 前缀(例如,http://example.com/我的文件.htm)。

要修正此问题,您应当决定您希望 Google 以何种方式来将您网站中的网址编入索引。

如果您希望 Google 使用 www 前缀将您网站中的网址编入索引,那么,您应当修改您的 Sitemap,并将 www 前缀添加到其中所列出的网址中,然后重新提交您的 Sitemap。

如果您不希望 Google 使用 www 前缀将您网站中的网址编入索引,那么,您应当从您的 Google Sitemaps 帐户中删除 Sitemap,并使用不含有 www 前缀的路径(例如 http://example.com/sitemap.xml)重新提交您的 Sitemap。如果选择这种方式,那么,您不需要修改您 Sitemap 中的网址。

命名空间错误

如果您看到此错误消息,这表明,我们检测到您的根元素并未指定默认的命名空间。应将命名空间指定为以下内容:

xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"

 

以下原因可导致此错误:
  • 命名空间缺失
  • 未正确声明命名空间(例如,命名空间应以".9"结束,而非"0.9")。

Sitemap 文件的开头应为以下格式:
 

Sitemap 索引文件的开头应为以下格式:

开头的空格

我们检测到您的 Sitemap 文件以空格开头。我们已接受了该文件,但您最好删除该空格,以使文件符合 XML 标准。

XML 文件的开头应为用于指定所使用的 XML 版本的 XML 声明。如果您看到此错误消息,这表明我们检测到您的 Sitemap 以空格开头。我们已接受了此 Sitemap,但会显示错误消息,以便您能修改 Sitemap(删除空格),使其符合相应的标准。

特定的 HTTP 错误

如果我们在尝试下载您的 Sitemap 时遇到了 HTTP 错误,那么,我们会列出所收到的状态代码(例如 404)。请确保您所指定的 Sitemap 网址是正确的,并且,您的 Sitemap 已位于此位置。然后重新提交您的 Sitemap。


警告
除错误消息外,我们还会列出我们在您的 Sitemap 中发现的问题的警告。通常,这些警告不会阻止我们对您的 Sitemap 进行处理。然而,由于这些警告可能会指出您网站所存在的潜在问题,因此,我们建议您仔细查看您的 Sitemap 文件并修复我们所指明的所有问题。


W3C Datetime 编码为什么东东?
 

Introduction

The International Standard for the representation of dates and times is ISO 8601. Its full reference number is ISO 8601 : 1988 (E), and its title is "Data elements and interchange formats - Information interchange - Representation of dates and times". A discussion of ISO 8601 has been written by Markus Kuhn.

ISO 8601 describes a large number of date/time formats. For example it defines Basic Format, without punctuation, and Extended Format, with punctuation, and it allows elements to be omitted. This profile defines a restricted range of formats, all of which are valid ISO 8601 dates and times. The aim is to simplify the use of ISO 8601 in World Wide Web-related standards, and to avoid the need for the developers and users of these standards to obtain copies of ISO 8601 itself.

A particular problem with ISO 8601 is that it allows the century to be omitted from years, which is likely to cause trouble as we approach the year 2000. This profile avoids the problem by expressing the year as four digits in all cases.

This profile may be adopted by standards which require an unambiguous representation of dates and times. As different standards have their own requirements regarding granularity and flexibility, this profile offers a number of options. An adopting standard must specify which of these options it permits.


Formats

Different standards may need different levels of granularity in the date and time, so this profile defines six levels. Standards that reference this profile should specify one or more of these granularities. If a given standard allows more than one granularity, it should specify the meaning of the dates and times with reduced precision, for example, the result of comparing two dates with different precisions.

The formats are as follows. Exactly the components shown here must be present, with exactly this punctuation. Note that the "T" appears literally in the string, to indicate the beginning of the time element, as specified in ISO 8601.

   Year:
      YYYY (eg 1997)
   Year and month:
      YYYY-MM (eg 1997-07)
   Complete date:
      YYYY-MM-DD (eg 1997-07-16)
   Complete date plus hours and minutes:
      YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
   Complete date plus hours, minutes and seconds:
      YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
   Complete date plus hours, minutes, seconds and a decimal fraction of a
second
      YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)

where:

     YYYY = four-digit year
     MM   = two-digit month (01=January, etc.)
     DD   = two-digit day of month (01 through 31)
     hh   = two digits of hour (00 through 23) (am/pm NOT allowed)
     mm   = two digits of minute (00 through 59)
     ss   = two digits of second (00 through 59)
     s    = one or more digits representing a decimal fraction of a second
     TZD  = time zone designator (Z or +hh:mm or -hh:mm)

This profile does not specify how many digits may be used to represent the decimal fraction of a second. An adopting standard that permits fractions of a second must specify both the minimum number of digits (a number greater than or equal to one) and the maximum number of digits (the maximum may be stated to be "unlimited").

This profile defines two ways of handling time zone offsets:

  1. Times are expressed in UTC (Coordinated Universal Time), with a special UTC designator ("Z").
  2. Times are expressed in local time, together with a time zone offset in hours and minutes. A time zone offset of "+hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes ahead of UTC. A time zone offset of "-hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes behind UTC.

A standard referencing this profile should permit one or both of these ways of handling time zone offsets.


Examples

1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.

1994-11-05T13:15:30Z corresponds to the same instant.