2016-09-12 8 views
3

私のsitemap.xmlファイルに言語を追加しようとしていますが、 "ネームスペースプレフィックスxhtmlが定義されていません"というエラーが表示されます。どのように定義したのですか?私はGoogle上で有用な何かを見つけることができません。リンク上のネームスペースプレフィックスxhtmlが定義されていません - sitemap.xml

<?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

私はこのようなことにあまり慣れていませんが、ここのGoogleの例は、異なる名前空間のものを使用しているようです。https://support.google.com/webmasters/answer/2620865?hl=en –

+0

'xsi'と' schemaLocation'接頭辞を定義してください... – Quentin

答えて

5

これは、仕事をするでしょう。ここ

はファイルです。

変更

<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" 
> 

説明

与えられたとしてxmlns:xhtmlを定義します。 xmlns:xhtmlをスキーマが格納されている場所にマップしますhttp://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd

+0

それはうまくいきました、ありがとう。 WooRank.comのようなサイトデータの検出にもいくつかの問題があります。 – crystyxn

関連する問題