Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's not entirely clear which aspect of the manual solution you regard as horrible; if it's the idea of having to define <em>n</em> different types just because they will need to extend <em>n</em> different base types, then you're stuck.</p> <p>If it's the idea of having to have <em>n</em> different declarations for the <code>format</code> and <code>isVisible</code> attributes, then you might find it less horrible to use a named attribute group to hold those definitions:</p> <pre><code>&lt;xs:attributeGroup name="globals"&gt; &lt;xs:attribute name="format" type="xs:string"/&gt; &lt;xs:attribute name="isVisible" type="xs:boolean"/&gt; &lt;/xs:attributeGroup&gt; </code></pre> <p>The declarations of the various complex types you need remain repetitive but are now slightly less verbose:</p> <pre><code>&lt;xs:complexType name="string"&gt; &lt;xs:simpleContent&gt; &lt;xs:extension base="xs:string"&gt; &lt;xs:attributeGroup ref="my:globals"/&gt; &lt;/xs:extension&gt; &lt;/xs:simpleContent&gt; &lt;/xs:complexType&gt; &lt;xs:complexType name="dateTime"&gt; &lt;xs:simpleContent&gt; &lt;xs:extension base="xs:dateTime"&gt; &lt;xs:attributeGroup ref="my:globals"/&gt; &lt;/xs:extension&gt; &lt;/xs:simpleContent&gt; &lt;/xs:complexType&gt; &lt;xs:complexType name="int"&gt; &lt;xs:simpleContent&gt; &lt;xs:extension base="xs:int"&gt; &lt;xs:attributeGroup ref="my:globals"/&gt; &lt;/xs:extension&gt; &lt;/xs:simpleContent&gt; &lt;/xs:complexType&gt; </code></pre> <p>And the declarations of your elements are now slightly simpler than in your 'ideal' case:</p> <pre><code>&lt;xs:element name="DocumentDescription" type="my:string" /&gt; &lt;xs:element name="DocumentDateTime" type="my:dateTime" /&gt; &lt;xs:element name="DocumentSize" type="my:int" /&gt; </code></pre>
 

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