namespace prefix xhtml on link is not defined - sitemap.xml

馋奶兔 提交于 2019-12-04 19:34:27

问题


I am trying to add language to my sitemap.xml file, but I get a "namespace prefix xhtml on link is not defined" error. How do I defined it? I cannot find anything useful on google.

Here is the file:

<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->
  <url>
    <loc>https://www.leepio.dk/</loc>


</urlset>

回答1:


This would do the work.

Change

<urlset
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
    http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"
    xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"   
>

Explanation

Define the xmlns:xhtml as given. Map the xmlns:xhtml to a place, where the schema is stored http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd.



来源:https://stackoverflow.com/questions/39450542/namespace-prefix-xhtml-on-link-is-not-defined-sitemap-xml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!