title: XML Schema import -vs- namespaces bound to prefixes
body: <p>I am new to XML Schema and am coming across schema documents that bind a number of prefixes to various namespaces in the <code>xsd:schema</code> root element and also import <strong>a subset</strong> of such schemas. In the rest of the XML Schema document they happily make use of all prefixes bound in the <code>xsd:schema</code> element (whether imported or not).</p>
  
  <p>So what does an <code>import</code> of a namespace signify over 'just' binding that namespace to a prefix?</p>
  
  <p>From the <a href="https://rads.stackoverflow.com/amzn/click/com/0132886723" rel="noreferrer" rel="nofollow noreferrer">Definitive XML Schema</a> book I read (pg. 66):</p>
  
  <p><i>an import is used to tell the processor that you will be referring to components from other namespaces</i></p>
  
  <p>In my understanding, that's also what a binding does, so what's the difference?</p>
  
  <h2>concrete example</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
             xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0"
             xmlns:ssap="http://www.ivoa.net/xml/SSA/v1.0"
             xmlns:vm="http://www.ivoa.net/xml/VOMetadata/v0.1"
             targetNamespace="http://www.ivoa.net/xml/SSA/v1.0"
             elementFormDefault="unqualified" 
             attributeFormDefault="unqualified"
             version="1.0pr2"&gt;
  
  
     &lt;xs:import namespace="http://www.ivoa.net/xml/VOResource/v1.0"
           schemaLocation="http://www.ivoa.net/xml/VOResource/v1.0"/&gt;
  
     &lt;!--  ... rest of the schema document follows --&gt;
  </code></pre>
  
  <p>Namespace <code>http://www.ivoa.net/xml/VOResource/v1.0</code> in the above schema document is both bound to the <strong>vr</strong> prefix and imported. Other namespaces are only bound to certain prefixes and not imported. The rest of the document uses components from both <strong>vr</strong> (bound and imported) and <strong>ssa</strong> (bound but not imported) prefixes. What's the difference?</p>