我正在尝试设置以下配置。
但是,当我尝试使用验证器(validome.org)验证站点地图XML时,出现以下错误:匹配的通配符很严格,但是找不到元素'xhtml:link'的声明。
我尝试验证的测试站点地图:
<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
http://www.w3.org/2002/08/xhtml www.w3.org/2002/08/xhtml/xhtml1-strict.xsd">
<url>
<loc>http://mobile.example.com/article100.html</loc>
<xhtml:link rel="nofollow" href="http://www.example.com/schweiz-deutsch/" />
</url>
</urlset>
我已经尝试过更改架构和名称空间,但是到目前为止还没有运气。任何人都可以在这里确定问题吗?
尝试将这些架构与xhtml:link交替使用
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>http://www.example.com/mypage.html</loc>
<xhtml:link rel="alternate" media="only screen and (max-width: 640px)" href="http://mobile.example.com/mypage.html" />
<lastmod>20015-04-01</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句