title: xsd schema not valid?
body: <p>I've downloaded the official "schema of xsd" from <a href="http://www.w3.org/2001/XMLSchema.xsd" rel="nofollow noreferrer">http://www.w3.org/2001/XMLSchema.xsd</a>.</p>
  
  <p>I saved it locally and tried to validate with this code:</p>
  
  <pre><code>var sc = XmlSchema.Read(new FileStream(@"c:\temp\xsd.xsd", FileMode.Open), validate);
  sc.Compile(validate);
  </code></pre>
  
  <p>It failed with an exception that it cannot find some DTD.</p>
  
  <p><strong>Question number 1</strong>: Why does the schema of xsd contain definition that xml validators cannot handle?</p>
  
  <p>I removed the DTD definition from the top of the file and I got this (and many more) validation errors:</p>
  
  <pre><code>"Restriction of 'anySimpleType' is not allowed."
  </code></pre>
  
  <p><strong>Question number 2</strong>: Why does compiling the schema of xsd fail?</p>
  
  <p>I've tried the same with XmlSchemaSet using set.Add(...) and <strong>it worked</strong>.</p>
  
  <p><strong>Question number 3</strong>: What is the difference between validating an XmlSchema and XmlSchemaSet?</p>
  
  <p>I then create a dummy schema that imports the xsd schema from disk:</p>
  
  <pre><code>&lt;s:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="c:\temp\xsd.xsd" /&gt;
  </code></pre>
  
  <p>When I add this schema to the schema set it fails again with the same errors as above.</p>
  
  <p><strong>Question number 4</strong>: Why is that different then directly adding the xsd schema (which worked)?</p>