Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XSD For Sitemap with HREFLANG

Tags:

seo

xsd

sitemap

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).

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!

like image 673
jakejgordon Avatar asked May 28 '13 18:05

jakejgordon


1 Answers

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"
like image 68
datahell Avatar answered Nov 15 '22 07:11

datahell