大网数据广告活动
网站运营与故障问答

Sitemap does not get render correctly

· 52CE 我爱测

I recently did some changes to my sitemap because i updated my website to support two languages but now i get an error when submitting the sitemap and i don't see where the problem is. Your Sitemap or Sitemap index file does not …

问题原文

原帖链接 · Steve · CC BY-SA 4.0

I recently did some changes to my sitemap because i updated my website to support two languages but now i get an error when submitting the sitemap and i don't see where the problem is.

Your Sitemap or Sitemap index file does not properly declare the namespace.
>     Examples
>     Line 5
>     Parent tag:
>     url
>     Tag:
>     link



    <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/TR/xhtml11/xhtml11_schema.html" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.w3.org/TR/xhtml11/xhtml11_schema.html http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd">
    <url>
    <loc>https://example.com/</loc>
    <xhtml:link rel="canonical" href="https://example.com/"/>
    <xhtml:link rel="alternate" hreflang="el" href="https://example.com/"/>
    <xhtml:link rel="alternate" hreflang="el-GR" href="https://example.com/"/>
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en"/>
    <lastmod>2020-02-25T12:41:35+00:00</lastmod>
    <priority>1.00</priority>
    </url>
 
           ````````

    
    </urlset>

***Update

Tried this method like the Google Documentation says so

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

Although when using xmlns:xhtml="http://www.w3.org/1999/xhtml" converts the xml to plain text, changing http to https outputs the xml correctly and does the work but i have read you must use only http to avoid my issue, honestly this it too confusing.

已采纳解答

原帖链接 · Steve · CC BY-SA 4.0

Ended up using xmlns:xhtml="http://www.w3.org/1999/xhtml" looks like it's Google Chrome's issue that doesn't render the XHTML correctly (if i did understand correctly), the sitemap works fine now even though it is not rendered correctly.

You can read more about it here

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2021-06-23)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。