ZVON > Tutorials > XML Schema and Relax NG Tutorial |
Intro / Search / ZVON |
Index | >> Example 4 / 8 << | Prev | Next | |
Please, send all comments, bug-reports, and contributions to Jiri.Jirat@systinet.com. Thank you very much.
XML Schema keys: maxOccurs, restrictionThe "maxOccurs" of the type derived by a restriction cannot be higher than the "maxOccurs" attribute of the original type (from which it is restricted). Schema Component Constraint: Particle Derivation OK (All:All,Sequence:Sequence - Recurse), 1. .
Incorrect XML Schema (incorrect_0.xsd) <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <xsd:element name="root" type="BBB"/> <xsd:complexType name="AAA"> <xsd:sequence maxOccurs="2"> <xsd:element name="x" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="BBB"> <xsd:complexContent> <xsd:restriction base="AAA"> <xsd:sequence maxOccurs="3"> <xsd:element name="x" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:restriction> </xsd:complexContent> </xsd:complexType> </xsd:schema> |