簡體   English   中英

XML站點地圖中是否需要xsi和架構部分? 他們的意思是什么?

[英]Are the xsi and schema portions needed in an XML sitemap? What do they mean?

對於我網站的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">

我是否需要包括第一個示例中的所有其他內容?

使用多余的零件或不使用多余的零件到底有什么區別?

僅當您想根據Sitemaps.org XSD驗證XML(或者如果您使用其他利用XML的XML工具)時,才需要提供架構。 請參閱驗證站點地圖

如果您不需要此功能(很可能不需要,否則您可能不會問),那么使用它就足夠了

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM