P
pif34
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 ?
Thanks.
<?xml version="1.0" encoding="UTF-8"?>
<users xmlns="..." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="... users.xsd">
<personne>
<matricule>123456</matricule>
<nom>Fabien</nom>
<roles>
<role>redacteur</role>
<role>responsable_technique</role>
</roles>
</personne>
</users>
and here is my schema:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="..." xmlns="...">
<xs:element name="users">
<xs:complexType>
<xs:sequence>
<xs:element name="personne" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="matricule" type="xs:string"/>
<xs:element name="nom" type="xs:string"/>
<xs:element name="roles">
<xs:complexType>
<xs:sequence>
<xs:element name="role" minOccurs="1" maxOccurs="unbounded">
<xs:simpleType>
<xs:restriction base="xs:string">
<xsattern value="redacteur|responsable_technique"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
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 ?
Thanks.
<?xml version="1.0" encoding="UTF-8"?>
<users xmlns="..." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="... users.xsd">
<personne>
<matricule>123456</matricule>
<nom>Fabien</nom>
<roles>
<role>redacteur</role>
<role>responsable_technique</role>
</roles>
</personne>
</users>
and here is my schema:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="..." xmlns="...">
<xs:element name="users">
<xs:complexType>
<xs:sequence>
<xs:element name="personne" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="matricule" type="xs:string"/>
<xs:element name="nom" type="xs:string"/>
<xs:element name="roles">
<xs:complexType>
<xs:sequence>
<xs:element name="role" minOccurs="1" maxOccurs="unbounded">
<xs:simpleType>
<xs:restriction base="xs:string">
<xsattern value="redacteur|responsable_technique"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>