Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Please format your xml so it's easier to read - like this:</p> <pre><code>&lt;jobs&gt; &lt;job&gt; &lt;id&gt;1&lt;/id&gt; &lt;state&gt;&lt;![CDATA[IL]]&gt;&lt;/state&gt; &lt;/job&gt; &lt;job&gt; &lt;id&gt;2&lt;/id&gt; &lt;/job&gt; &lt;/jobs&gt; </code></pre> <p>I think you're not actually validating it - the namespaces mean that that XML does not validate, even with a "<code>&lt;state&gt;</code>" in the second "<code>&lt;job&gt;</code>". Specifically, the XSD has a target namespace of "<code>http://foo.org/importvalidator.xsd</code>", but the XML has no namespace given.</p> <p>Set up a trivial test case of XSD and XML, that you definitely know will fail - use that to track down why you aren't validating.</p> <p>Also, your XSD is missing the close tags for element and schema, so it should give an error - or it's just a mis-paste :-)</p> <hr> <p>You can remove the targetNamespace from the schema:</p> <pre><code>&lt;xs:schema id="importvalidator" elementFormDefault="qualified" targetNamespace="http://foo.org/importvalidator.xsd ← DELETE THIS" xmlns="http://foo.org/importvalidator.xsd" xmlns:mstns="http://foo.org/importvalidator.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; </code></pre> <p>So it looks like this:</p> <pre><code>&lt;xs:schema id="importvalidator" elementFormDefault="qualified" xmlns="http://foo.org/importvalidator.xsd" xmlns:mstns="http://foo.org/importvalidator.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; </code></pre> <p>PS: anyone know if/how you can highlight parts of source code with SO's markdown?</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