Exemple Schema xml

Transcription

Exemple Schema xml
Schema xml <?xml version="1.0" encoding="utf‐8"?> <xs:schema id="bc" targetNamespace="cours.bc" elementFormDefault="qualified" xmlns="cours.bc" xmlns:mstns="cours.bc" xmlns:xs="http://www.w3.org/2001/XMLSchema" > <xs:element name="bc"> <xs:complexType> <xs:sequence> <xs:element name="organisation" minOccurs="2" maxOccurs="2"> <xs:complexType> <xs:sequence> <xs:element name="nom" type="xs:string"/> <xs:element name="adresse" type="xs:string"/> <xs:element name="tel" type="xs:string"/> <xs:element name="telecopie" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="date" type="xs:date"/> <xs:element name="total" type="xs:int"/> <xs:element name="ligne" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="ref" type="xs:string"/> <xs:element name="intitule" type="xs:string"/> <xs:element name="quantite" type="xs:int"/> <xs:element name="prix" type="xs:double"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Document XML <?xml version="1.0" encoding="utf‐8" ?> <bc xmlns="cours.bc" xmlns:xsi="http://www.w3.org/2001/XMLSchema‐instance" xsi:schemaLocation="cours.bc bc.xsd"> <organisation> <nom></nom> <adresse></adresse> <tel></tel> </organisation> <organisation> <nom></nom> <adresse></adresse> <tel></tel> </organisation> <date>2016‐01‐01</date> <total>1333</total> <ligne> <ref></ref> <intitule></intitule> <quantite>10</quantite> <prix>1344</prix> </ligne> </bc> 

Documents pareils