Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It is possible to create a schema importing and using another schema. This defines your <code>customer</code> element with <code>customertype</code> containing a schema:</p> <pre><code>&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xml.netbeans.org/schema/Notes" xmlns:tns="http://xml.netbeans.org/schema/Notes" elementFormDefault="qualified"&gt; &lt;xsd:import namespace="http://www.w3.org/2001/XMLSchema"/&gt; &lt;xsd:element name="customer"&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="customername" type="xsd:string"/&gt; &lt;xsd:element name="customertype"&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence&gt; &lt;xsd:element ref="xsd:schema"/&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:schema&gt; </code></pre> <p>The problem is that you have an additional condition on the <code>customertype</code> schema - so you should in theory get the standard XSD schema and modify it, but there are many different ways to satisfy that condition in a schema definition, so it is very tricky (and maybe impossible) to do this 'modification'</p> <p>Probably a better approach is restrict the possible schemas used inside <code>customertype</code> (e.g. it must be a single element definition with complex type specified directly etc. etc) and write a sub-set of the XSD schema that describe this restricted schema definition.</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