Le 30/12/2011 11:12, Lindberg a écrit :
> pif34 wrote:
>> Hello, de XML document I want to create. My error message is :
>>
>>
>> cvc-complex-type.2.4.a: Invalid content was found starting with
>> element 'personne'. One of '{personne}' is expected.
>>
>> Can you explain me the error ?
>
> Your Schema is just broken, garbage:
do you mean xsd is not valid ? perhaps I've made an error when
pasting/indenting... but when I validate it, the xsd is ok.
so here is another xsd that has same problem. Can you detail what is
"broken" ?
Thanks.
targetNamespace="
http://www.eurocopter.com/Users"
xmlns="
http://www.eurocopter.com/Users">
<xs:element name="users" type="usersType">
</xs:element>
<xs:complexType name="userType">
<xs:sequence>
<xs:element name="matricule" type="xs:string" maxOccurs="1"
minOccurs="1"></xs:element>
<xs:element name="nom" type="xs:string" maxOccurs="1"
minOccurs="1"></xs:element>
<xs:element name="role" type="xs:string" maxOccurs="unbounded"
minOccurs="1"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="usersType">
<xs:sequence>
<xs:element name="user" type="userType"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<users xmlns="
http://www.X.com/Users"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.x.com/Users users.xsd">
<user>
<matricule>123456</matricule>
<nom>john</nom>
<role>redacteur</role>
<role>responsable_technique</role>
</user>
</users>