title: How to use w3c sitemap.xsd to validate w3c sitemap & google sitemap?
body: <p>w3c sitemap.xsd: <a href="http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" rel="nofollow">http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd</a><br>
  It looks like this:</p>
  
  <pre><code>&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" targetNamespace="http://www.sitemaps.org/schemas/sitemap/0.9" elementFormDefault="qualified"&gt;
  </code></pre>
  
  <p>I have two sitemap file.<br>
  1. w3c sitmap file, like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;                                                                                                                                                                                                       
  &lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&gt;
  &lt;url&gt;&lt;loc&gt;http://t.qq.com/p/t/42509089158929/&lt;/loc&gt;&lt;/url&gt;
  &lt;/urlset&gt;
  </code></pre>
  
  <p>2.google-sitemap file, like this：</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;urlset xmlns="http://www.google.com/schemas/sitemap/0.9"&gt; 
  &lt;url&gt;
  &lt;loc&gt;http://blog.ifeng.com/article/11487489.html&lt;/loc&gt;
  &lt;lastmod&gt;2011-05-23T09:33:01+08:00&lt;/lastmod&gt;
  &lt;changefreq&gt;daily&lt;/changefreq&gt;
  &lt;priority&gt;1.0&lt;/priority&gt;
  &lt;/url&gt;
  &lt;/urlset&gt;
  </code></pre>
  
  <p>I use w3c sitemap.xsd to validate these two files by xmllint.<br>
  1. w3c stitemap file, normal and success<br>
  2. google-sitemap file, output like below</p>
  
  <pre><code>$ xmllint --schema sitemap.xsd sitemap_google.xml  --noout 
  sitemap_google.xml:2: element urlset: Schemas validity error : Element '{http://www.google.com/schemas/sitemap/0.9}urlset': No matching global declaration available for the validation root.
  sitemap_google.xml fails to validate
  </code></pre>
  
  <p>I think, the problem is the namespace is different in google-sitemap.xml and sitemap.xsd.
  How should I do to use sitemap.xsd to validate these two sitemap file?</p>
  
  <p>Thanks!</p>