XSD design patterns
<p>I start with XML and almost all everything that is involved, working in XML Oxygen editor. I have met 3 basic design patterns of XSD schema and I don't know which one should suit my needs the most and in general. </p>

<p>I want to create a large schema validating a XML file containing teams with players.</p>

<p>My question is which one is the best and is considered to be the most well-arranged, user-friendliest and professional for my purpose and in general? Which one is practically the most common and what do you recommend me as to the beginner with XML to the future?</p>

<p>Here are my samples of all designs I know:</p>

<hr>

<p><strong>Matryoshka</strong></p>

<p>I have started with this one, because it was simply understandable. No references at referencing to types all. I am sure this one is suitable for tiny files.</p>

<pre><code>&lt;xsd:element name="player"&gt;
    &lt;xsd:complexType&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name="name" type="xsd:string"/&gt;
            &lt;xsd:element name="skill" type="xsd:float"/&gt;
            &lt;xsd:element name="nationality"&gt;
                &lt;xsd:simpleType&gt;
                    &lt;xsd:restriction base="xsd:string"&gt;
                        &lt;xsd:pattern value="\d{3}"/&gt;
                    &lt;/xsd:restriction&gt;
                &lt;/xsd:simpleType&gt;
            &lt;/xsd:element&gt;
        &lt;/xsd:sequence&gt; 
    &lt;/xsd:complexType&gt;
&lt;/xsd:element&gt;  
</code></pre>

<hr>

<p><strong>Venetian Blind</strong></p>

<p>This is my the most favourite one, because of defining the sctructire in the beginning and then all types of elements.</p>

<pre><code>&lt;xsd:element name="player" type="playerType"/&gt;

&lt;xsd:complexType name="playerType"&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name="name" type="xsd:string"/&gt;
            &lt;xsd:element name="skill" type="xsd:float"/&gt;
            &lt;xsd:element name="nationality" type="nationalityType"/&gt;
        &lt;/xsd:sequence&gt; 
&lt;/xsd:complexType&gt;

&lt;xsd:simpleType name="nationalityType"&gt;
    &lt;xsd:restriction base="xsd:string"&gt;
        &lt;xsd:pattern value="\d{3}"/&gt;
    &lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
</code></pre>

<hr>

<p><strong>Salami Slice</strong></p>

<p>This one was the most recommended me, although I see that XML file can contain only one of elements as well as all of them. I am quite confused of this design.</p>

<pre><code>&lt;xsd:element name="player"&gt;
    &lt;xsd:complexType&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element ref="name"/&gt;
            &lt;xsd:element ref="skill"/&gt;
            &lt;xsd:element ref="nationality"/&gt;
        &lt;/xsd:sequence&gt; 
    &lt;/xsd:complexType&gt;
&lt;/xsd:element&gt;  

&lt;xsd:element name="name" type="xsd:string"/&gt;

&lt;xsd:element name="skill" type="xsd:float"/&gt;

&lt;xsd:element name="nationality"&gt;
    &lt;xsd:simpleType&gt;
        &lt;xsd:restriction base="xsd:string"&gt;
            &lt;xsd:pattern value="\d{3}"/&gt;
        &lt;/xsd:restriction&gt;
    &lt;/xsd:simpleType&gt;
&lt;/xsd:element&gt;
</code></pre>