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.
I want to create a large schema validating a XML file containing teams with players.
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?
Here are my samples of all designs I know:
Matryoshka
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.
<xsd:element name="player">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="skill" type="xsd:float"/>
<xsd:element name="nationality">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d{3}"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Venetian Blind
This is my the most favourite one, because of defining the sctructire in the beginning and then all types of elements.
<xsd:element name="player" type="playerType"/>
<xsd:complexType name="playerType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="skill" type="xsd:float"/>
<xsd:element name="nationality" type="nationalityType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="nationalityType">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d{3}"/>
</xsd:restriction>
</xsd:simpleType>
Salami Slice
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.
<xsd:element name="player">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="name"/>
<xsd:element ref="skill"/>
<xsd:element ref="nationality"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="skill" type="xsd:float"/>
<xsd:element name="nationality">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d{3}"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>