Bonsoir à tous !
Je bloque sur l'écriture d'un XML Schema qui parait pourtant simple.
Voici le fichier XML :
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 <?xml version="1.0" encoding="utf-8" standalone="no" ?> <book isbn="0836217462" xsi:noNamespaceSchemaLocation="exercice3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">> <title>Being a Dog Is a Full-Time Job</title> <author>Charles M. Schulz</author> <character> <name>Snoopy</name> <friend-of>Peppermint Patty</friend-of> <since>1950-10-04</since> <qualification>extroverted beagle</qualification> </character> <character> <name>Peppermint Patty</name> <since>1966-08-22</since> <qualification>bold, brash and tomboyish</qualification> </character> </book>
Et voici mon schéma :
Code : XML - Sélectionner
Voici l'erreur que me signale EditiX :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 <?xml version="1.0" encoding="UTF-8" ?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!-- ROOT TAG --> <xsd:element name="book" type="t_book" /> <!-- TYPE BOOK --> <xsd:complexType name="t_book"> <xsd:sequence> <xsd:element name="title" type="xsd:string" /> <xsd:element name="author" type="xsd:string" /> <xsd:element name="character" type="t_character" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="isbn" use="required" type="xsd:string" /> </xsd:complexType> <!-- TYPE CHARACTER --> <xsd:complexType name="t_character"> <xsd:sequence> <xsd:element name="name" type="xsd:string" /> <xsd:element name="friend-of" type="xsd:string" minOccurs="0" /> <xsd:element name="since" type="xsd:date" /> <xsd:element name="qualification" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:schema>
Je ne comprends pas où est le problème...Citation:
cvc-complex-type.2.3: Element 'book' cannot have character [children], because the type's content type is element-only.
Merci d'avance pour votre aide !