Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>&lt;xs:import&gt;</code> is used to import namespaces defined in other schema into the current schema. The <code>schemaLocation</code> attribute is nothing more than a hint as to where to find that other namespace.</p> <p>In the case of <code>B.xsd</code>, you're saying that you want to import the namespace <code>http://blah.org</code>, and that that namespace is handled by the schema in <code>A.xsd</code>.</p> <p>In the case of <code>A.xsd</code>, your import of <code>B.xsd</code> is not specifying which namespace you're importing.</p> <p>If <code>A.xsd</code> and <code>B.xsd</code> are representing different namespaces, then the <code>import</code> needs to specify that explicitly.</p> <p>If, on the other hand, you're just trying to inline the elements from another schema file, in the same namespace, then the <code>include</code> directive is more appropriate.</p> <hr> <p><strong>edit:</strong> OK, having seen your schema fragments, I can say that <code>&lt;xs:import&gt;</code> is definitely not the right thing to do. Both <code>A.xsd</code> and <code>B.xsd</code> are defining elements in the same namespace (<code>http://foo.org/A</code>), and so you should be using <code>&lt;xs:include&gt;</code> instead.</p> <p>When Java encounters an <code>&lt;xs:import&gt;</code>, and the namespace of that import is a namespace that it already knows about, then it effectively ignores it. So as it's parsing <code>B.xsd</code> (in namespace <code>http://foo.org/A</code>), and it finds an import for that same namespace, it ignores it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload