title: How to reference local XSD from XML file?
body: <p>I want to write a simple XML file with a custom xsd file located in the same local directory on my computer. I don't understand the necessary syntax at the beginning of the files (I have googled but XSD tutorials seem to focus on the element definitions rather than the <code>xsd:schema</code>).</p>
  
  <p>My sys_params.xsd begins:</p>
  
  <pre><code>&lt;xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema"&gt;
  
  &lt;xsd:element     name="shipOrder" type="order"/&gt;
  </code></pre>
  
  <p>My sys_params.xml begins:</p>
  
  
  
  <pre><code>&lt;shiporder orderid="889923"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.w3schools.com sys_params.xsd"
  
  &lt;orderperson&gt;John Smith&lt;/orderperson&gt;
  </code></pre>
  
  <p>My XML reports this validation error on the xml:</p>
  
  <blockquote>
    <p>Error schema document 'sys_params.xsd' has different target namespace
    from the one specified in instance document '<a href="http://www.w3schools.com" rel="nofollow">http://www.w3schools.com</a>'</p>
  </blockquote>
  
  <p>No doubt my code is quite wrong but I need some help to correct it please.</p>