Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I assume your question is what should the XSD look like to match your XML. This is the corrected XSD:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;!-- XML Schema generated by QTAssistant/XSD Module (http://www.paschidev.com) --&gt; &lt;xsd:schema targetNamespace="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;xsd:element name="XMLimport"&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="Leverancier" type="xsd:string"/&gt; &lt;xsd:element name="Bestandsversie" type="xsd:string"/&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:schema&gt; </code></pre> <p>Your XSD doesn't define a <code>targetNamespace</code> attribute. Hence, your <strong>XMLimport</strong> must show without a namespace in instance documents; this is why when you remove the namespace from your <strong>XMLimport</strong> in the XML document, it becomes valid.</p> <p>If you add <code>targetNamespace="http://www.w3.org/2001/XMLSchema"</code> you'll now have an XSD that will validate your XML; in general, the value of the targetNamespace must match the namespace of your document element (chameleon XSDs are a special case).</p> <p>Another thing at play here is <code>elementFormDefault</code> which by default is <code>unqualified</code>. This setting is that which makes the inner elements <code>Leverancier</code> and <code>Bestandsversie</code> without a namespace.</p> <p>Another thing to notice is that while it is highly unusual to see user defined content targeting the <code>http://www.w3.org/2001/XMLSchema</code> namespace, there's no provision in the XSD 1.0 spec which would explicitly prohibit users to target this namespace. This is unlike the other namespace you see in your sample XML, <code>http://www.w3.org/2001/XMLSchema-instance</code>: it is explicitly prohibited to target this namespace in user defined XSDs.</p> <p><a href="https://stackoverflow.com/questions/7190572/targetnamespace-and-xmlns-without-prefix-what-is-the-difference/7200002#7200002">This SO post</a> might help, too.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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