title: VB.Net Validate an xml against a schema (strange problem)
body: <p>I have written a small XML validator, that takes in an XML file and an XML schema and validates the XML files against that schema. It works well, except for an XML file, with this content:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xc:program xmlns:xc="http:\\www.something.com\Schema\XC10" xc:version="4.0.22.0" &gt;
      &lt;xc:namespaceDecls&gt;
          &lt;xc:namespaceDecl xc:namespaceDeclURI="urn:swift:xsd:abc"&gt;
              &lt;xc:namespaceDeclPrefix&gt;n&lt;/xc:namespaceDeclPrefix&gt;
          &lt;/xc:namespaceDecl&gt;
      &lt;/xc:namespaceDecls&gt;
  &lt;/xc:program&gt;
  </code></pre>
  
  <p>I tried to validate this XML file against a bunch of different schemas.
  No matter which schema I select, this XML file comes out as valid. What is it that I am missing?
  Here is the relevant piece of code:</p>
  
  <pre><code>//'Create a schema cache and add the given schema to it.
  Dim schemaCache As New Schema.XmlSchemaSet
  
  schemaCache.Add(targetNamespace, schemaFilename)
  
  //'Create an XML DOMDocument object.
  Dim xmlDom As New XmlDocument
  
  //'Assign the schema cache to the DOM document.
  //'schemas collection.
  xmlDom.Schemas = schemaCache
  
  //'Load selected file as the DOM document.
  xmlDom.Load(xmlFilename)
  xmlDom.Validate(AddressOf ValidationCallBack)
  </code></pre>