[Schema] Ajouter un nombre d'occurence
Bonjour
J'admet être débutant en écriture de fichier schema xsd.
Voici mon fichier XML :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
<?xml version="1.0" encoding="utf-8"?>
<header>
<title>Fasta</title>
<copyright>Copyrigth (c) 2005 BioXpr SA</copyright>
<licence begin="Licence advertising:"></licence>
<adress begin="Company contact:" name="Toto SA" street="Rue du noyé, 22" postal_code="5000" city="Namur" country="BELGIUM" />
<authors>
<author>
<name>david</name>
<email>david@toto</email>
</author>
<author>
<name>christian</name>
<email>christian@toto</email>
</author>
</authors>
<filename begin="File:">fasta.cpp</filename>
</header> |
Et mon fichier schema :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="header">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="copyright" minOccurs="0" type="xsd:string"/>
<xsd:element name="licence">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="begin" type="xsd:string" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="adress">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="begin" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="street" type="xsd:string"/>
<xsd:attribute name="postal_code" type="xsd:string"/>
<xsd:attribute name="city" type="xsd:string"/>
<xsd:attribute name="country" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="authors">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="author">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="email" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="filename">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="begin" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> |
Mon problème vient de l'élément authors. Je voudrais préciser qu'il peut y avoir un auteur au minimum sinon n.
Comment faire ?
Merci d'avance de vos réponses.
@++