sitemap.xml中优先级字段的精度是多少?
不幸的是,规范没有告诉任何有关精度的信息。 xml 方案定义 声明其类型为 xsd:decimal
:
<xsd:restriction base="xsd:decimal">
<xsd:minInclusive value="0.0"/>
<xsd:maxInclusive value="1.0"/>
</xsd:restriction>
我有一个站点地图生成器,最多使用小数点后 10 个位置。 通常只有最后几个位置不同。根据 xsd,这些数字完全正确,但我发现了一些页面(3, 4)指出只有 0.0、0.1、0.2、..、1.0 是有效值。
搜索引擎对这样的站点地图将如何反应?有些会四舍五入吗?
我知道除非他为该搜索引擎工作,否则不太可能有人可以提供该问题的答案,但我认为经验也可以。
Unfortunately the specification does not tell anything about precision.
The xml scheme definition states that it is of the type xsd:decimal
:
<xsd:restriction base="xsd:decimal">
<xsd:minInclusive value="0.0"/>
<xsd:maxInclusive value="1.0"/>
</xsd:restriction>
I have a sitemap generator that uses up to 10 positions after decimal point.
Where often only the last few positions differ. These numbers are perfectly right according to the xsd, but yet i found some pages(3,4) that state that only 0.0, 0.1, 0.2, .., 1.0 are valid values.
How will the search engines react to such a sitemap? Will some just round the value?
I know that it is unlikely that someone can provide an answer to that question, unless he works for that search engine, but i think experiences will also do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我无法评价这些值的精度,因为我从未使用过除一位小数之外的任何值。
根据我的经验,这并没有多大区别,只是 Google 会尝试先抓取优先级较高的页面,然后再抓取优先级较低的页面,有时甚至会更频繁。
除非您的网站上有数千个页面,否则这实际上没有任何区别。
I can't speak for the precision of those values as I've never used anything other than a single decimal place.
In my experience though it doesn't make much of a difference at all except that Google will try to crawl your higher priority pages first before the lower priority ones, and sometimes more frequently.
Unless you have thousands of pages on your site though, it really doesn't make any difference.
对不起;我对你的问题没有答案。我确实想知道站点地图生成器需要这种级别的精度来实现一个非常空灵的概念。
不要尝试准确地与搜索引擎共享您的优先级,而是采取以下步骤:
我不相信您会注意到搜索引擎的行为与您所看到的(如果他们能够理解这种精度水平)有任何差异。
I'm sorry; I don't have an answer to your question. I do wonder about the sitemap generator that needs this level of precision for a concept which is pretty ethereal to begin with.
Instead of trying to share your priorities with the search engines that accurately, take the following steps:
I do not believe you will notice any difference in the search-engine behaviour compared to what you would see if they could understand that level of precision.
如果您将站点地图提交到 Google 网站管理员工具,它应该会标记遇到的任何错误。
然而,你提到的精度水平是荒谬的,不会有任何效果。优先级首先只是一个模糊的指导,SE 无论如何都会返回与查询最匹配的页面。
我建议将所有数字四舍五入为 1dp(或 2dp 绝对最大值)。
If you submit the sitemap to Google Webmaster Tools it should flag up any errors it encounters.
However, the level of precision you mention is ridiculous and will not have any effect. The priority is only meant to be a vague guide in the first place, and the SEs will return the page that best matches the query anyway.
I'd recommend rounding all figures to 1dp (or 2dp absolute maximum).