Files
openide/xml/tests/testData/validateXml/enumerations.xsd
2018-12-20 15:33:55 +03:00

127 lines
5.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified"
elementFormDefault="qualified">
<xsd:element name="enumerations" type="enumerationsType">
<xsd:annotation>
<xsd:documentation>
Example enumerations:
<ol>
<li>
<strong>enumeration</strong>:
a simple (disallows annotations), closed (is not extensible) enumeration
</li>
<li>
<strong>enumerationWithAttributes</strong>:
a complex (allows annotations), closed (is not extensible) enumeration
</li>
<li>
<strong>openEnumeration</strong>:
a simple (disallows annotations), open (is extensible) enumeration
</li>
<li>
<strong>openEnumerationWithAttributes</strong>:
a complex (allows annotations), open (is extensible) enumeration
</li>
</ol>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="enumerationsType">
<xsd:sequence>
<xsd:element name="enumeration" type="enumerationType"
maxOccurs="unbounded" minOccurs="0"/>
<xsd:element name="enumerationWithAttributes" type="enumerationWithAttributesType"
maxOccurs="unbounded" minOccurs="0"/>
<xsd:element name="openEnumeration" type="openEnumerationType"
maxOccurs="unbounded" minOccurs="0"/>
<xsd:element name="openEnumerationWithAttributes" type="openEnumerationWithAttributesType"
maxOccurs="unbounded" minOccurs="0"/>
<xsd:element name="openEnumerationWithSimpleTypeChildUnion"
type="openEnumerationWithSimpleTypeChildUnionType"
maxOccurs="unbounded" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="enumerationType">
<xsd:annotation>
<xsd:documentation>
a simple (disallows annotations), closed (is not extensible) enumeration
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="A"/>
<xsd:enumeration value="B"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="enumerationWithAttributesType">
<xsd:annotation>
<xsd:documentation>
a complex (allows annotations), closed (is not extensible) enumeration
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="enumerationType">
<xsd:attributeGroup ref="enumerationAttributeGroup"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:attributeGroup name="enumerationAttributeGroup">
<xsd:annotation>
<xsd:documentation>
a reusable group of attributes for extending simple enumerations to make complex enumerations
</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="id" type="xsd:ID"/>
<xsd:attribute name="idref" type="xsd:IDREF"/>
</xsd:attributeGroup>
<xsd:simpleType name="openEnumerationType">
<xsd:annotation>
<xsd:documentation>
a simple (disallows annotations), open (is extensible) enumeration
</xsd:documentation>
</xsd:annotation>
<xsd:union memberTypes="xsd:int xsd:boolean enumerationType"/>
</xsd:simpleType>
<xsd:simpleType name="openEnumerationWithSimpleTypeChildUnionType">
<xsd:annotation>
<xsd:documentation>
a simple (disallows annotations), open (is extensible) enumeration
</xsd:documentation>
</xsd:annotation>
<xsd:union memberTypes="xsd:int">
<xsd:simpleType>
<xsd:annotation>
<xsd:documentation>
a simple (disallows annotations), closed (is not extensible) enumeration
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="A"/>
<xsd:enumeration value="B"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType>
<xsd:annotation>
<xsd:documentation>
a simple (disallows annotations), closed (is not extensible) enumeration
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="C"/>
<xsd:enumeration value="D"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:union>
</xsd:simpleType>
<xsd:complexType name="openEnumerationWithAttributesType">
<xsd:annotation>
<xsd:documentation>
a complex (allows annotations), open (is extensible) enumeration
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="openEnumerationType">
<xsd:attributeGroup ref="enumerationAttributeGroup"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema>