XSD For Sitemap with HREFLANG [英] XSD For Sitemap with HREFLANG

查看:24
本文介绍了XSD For Sitemap with HREFLANG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在推出一个支持 20 种语言和大量区域内容(即针对特定国家/地区或一组国家/地区的内容)的主要网站.因此,我们有一个教科书用例,用于在我们的站点地图中使用 xhtml:link 和 rel='hreflang'.我们通常更喜欢从 XSD 生成类,以便我们可以以编程方式生成保证兼容的 XML.我希望找到一个更新的 XSD,在定义中包含 xhtml:link.但是,我一直被指向基本站点地图 xsd:http://www.sitemaps.org/schemas/sitemap/sitemap.xsd ,它不支持 xhtml:link (在 xhtml-link-1.xsd 中定义).

We are launching a major website with support for 20 languages and tons of regional content (i.e. content that is targeted to a specific country or set of countries). As such, we have a textbook use case for using xhtml:link with rel='hreflang' in our sitemap. We generally prefer to generate classes from an XSD so that we can programmatically generate the XML that is guaranteed compliant. I was hoping to find an updated XSD that includes xhtml:link in the definitions. However, I keep getting pointed back to the base sitemap xsd: http://www.sitemaps.org/schemas/sitemap/sitemap.xsd , which has no support for xhtml:link (defined in xhtml-link-1.xsd).

看起来谷歌只支持 xhtml:link 元素及其支持的属性,但在我尝试手动修改基本的 sitemap.xsd 以包含它之前,我想看看是否有人花时间发布了 XSD已经有 http://www.sitemaps.org/schemas/sitemap/0.9http://www.w3.org/1999/xhtml 包括在内?如果是这样,你能指出我正确的方向吗?或者,如果我出于某种原因在这里走错了路,我也很感激被引导到正确的方向.在此先感谢您的帮助!

It looks like Google just supports an xhtml:link element with it's supported attributes, but before I try to modify the basic sitemap.xsd by hand to include this, I wanted to see if anyone has taken the time to publish an XSD that already has http://www.sitemaps.org/schemas/sitemap/0.9 and http://www.w3.org/1999/xhtml included? If so, could you point me in the right direction? Or if I'm headed down the wrong path here for some reason I also appreciate being steered in the right direction. Thanks in advance for the help!

推荐答案

带有来自 google 的 hreflang 的站点地图指南是错误的.站点地图未验证,因为名称空间中不存在 xhtml:link.

Sitemap guides with hreflang from google are wrong. The sitemap doesn't validate as the xhtml:link does not exist in namespace.

将命名空间更改为下面的命名空间,它将验证.

Change namespace to the one below and it will validate.

xmlns:xhtml="http://www.w3.org/TR/xhtml11/xhtml11_schema.html"

这篇关于XSD For Sitemap with HREFLANG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆