【问题标题】:Are the xsi and schema portions needed in an XML sitemap? What do they mean?XML 站点地图中是否需要 xsi 和模式部分?他们的意思是什么?
【发布时间】:2017-02-21 10:36:07
【问题描述】:

对于我网站的 XML 站点地图,我注意到不同的文章提出了不同的建议。

例如,在我的页面列表之前,一些文章建议这样开始:

  <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">

虽然其他文章仅使用:

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

我是否需要包含第一个示例中的所有额外内容?

使用额外的部分和不使用它们之间到底有什么区别?

【问题讨论】:

  • PS.. 是的,我已经在网站上搜索了答案,但无济于事,因为我找不到任何帖子专门解决了这个确切的问题。如果有人对这个主题有了解,我将不胜感激你的智慧。

标签: xml seo sitemap xsi xml-sitemap


【解决方案1】:

如果您想根据 Sitemaps.org XSD 验证 XML(或者如果您使用其他一些利用它的 XML 工具),您只需要提供架构。见Validating your Sitemap

如果你不需要这个(很可能你不需要,否则你可能不会问),使用它就足够了

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-21
    • 1970-01-01
    • 2016-08-17
    • 1970-01-01
    • 2014-05-23
    • 2010-09-10
    • 2012-05-02
    相关资源
    最近更新 更多