<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="persons" type="personsType"/> <xs:simpleType name="age"> <xs:restriction base="xs:integer"> <xs:minInclusive value="0"/> <xs:maxInclusive value="120"/> </xs:restriction> </xs:simpleType> <xs:complexType name="personType"> <xs:annotation> <xs:documentation xml:lang="en"> Represents on person </xs:documentation> </xs:annotation> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute type="xs:string" name="name" use="optional"/> <xs:attribute type="age" name="age" use="optional"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:complexType name="personsType"> <xs:sequence> <xs:element type="personType" name="person" maxOccurs="unbounded" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:schema>We will have the following document:
Copyright 2006-2016 Hervé. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences