summaryrefslogtreecommitdiffstats
path: root/sdo-java/trunk-cts/sdo2.1/src/main/resources/dynamicTypesFromSchema.xsd
blob: 03c0ff49f6089b1e308753eaa9fc8fa2fde882c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?xml version="1.0" encoding="UTF-8"?>
<!--
 *  Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 -->
<xsd:schema
 targetNamespace="http://www.example.com/dynamicTypesFromSchema"
 xmlns:dtfs="http://www.example.com/dynamicTypesFromSchema"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <!-- 
         elements and types for testElement0
         provides examples of using XML Schema primitive datatypes (see 3.2 of XML Schema Part 2)
         (QName and NOTATION omitted as they are not appropriate as types for element content.)
    -->

    <xsd:complexType name="TestType0" mixed="true">
        <xsd:sequence>
            <xsd:element name="string" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
            <xsd:element name="boolean" minOccurs="0" maxOccurs="unbounded" type="xsd:boolean"/>
            <xsd:element name="decimal" minOccurs="0" maxOccurs="unbounded" type="xsd:decimal"/>
            <xsd:element name="float" minOccurs="0" maxOccurs="unbounded" type="xsd:float"/>
            <xsd:element name="double" minOccurs="0" maxOccurs="unbounded" type="xsd:double"/>
            <xsd:element name="duration" minOccurs="0" maxOccurs="unbounded" type="xsd:duration"/>
            <xsd:element name="dateTime" minOccurs="0" maxOccurs="unbounded" type="xsd:dateTime"/>
            <xsd:element name="time" minOccurs="0" maxOccurs="unbounded" type="xsd:time"/>
            <xsd:element name="date" minOccurs="0" maxOccurs="unbounded" type="xsd:date"/>
            <xsd:element name="gYearMonth" minOccurs="0" maxOccurs="unbounded" type="xsd:gYearMonth"/>
            <xsd:element name="gYear" minOccurs="0" maxOccurs="unbounded" type="xsd:gYear"/>
            <xsd:element name="gMonthDay" minOccurs="0" maxOccurs="unbounded" type="xsd:gMonthDay"/>
            <xsd:element name="gDay" minOccurs="0" maxOccurs="unbounded" type="xsd:gDay"/>
            <xsd:element name="gMonth" minOccurs="0" maxOccurs="unbounded" type="xsd:gMonth"/>
            <xsd:element name="hexBinary" minOccurs="0" maxOccurs="unbounded" type="xsd:hexBinary"/>
            <xsd:element name="base64Binary" minOccurs="0" maxOccurs="unbounded" type="xsd:base64Binary"/>
            <xsd:element name="anyURI" minOccurs="0" maxOccurs="unbounded" type="xsd:anyURI"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="testElement0" type="dtfs:TestType0"/>

    <!-- 
         elements and types for testElement1
         provides examples of using XML Schema derived datatypes (see 3.3 of XML Schema Part 2)
         (ENTITY and ENTITIES omitted as they are not appropriate as types for element content.)
    -->

    <xsd:complexType name="TestType1" mixed="true">
        <xsd:sequence>
            <xsd:element name="normalizedString" minOccurs="0" maxOccurs="unbounded" type="xsd:normalizedString"/>
            <xsd:element name="token" minOccurs="0" maxOccurs="unbounded" type="xsd:token"/>
            <xsd:element name="language" minOccurs="0" maxOccurs="unbounded" type="xsd:language"/>
            <xsd:element name="NMTOKEN" minOccurs="0" maxOccurs="unbounded" type="xsd:NMTOKEN"/>
            <xsd:element name="NMTOKENS" minOccurs="0" maxOccurs="unbounded" type="xsd:NMTOKENS"/>
            <xsd:element name="Name" minOccurs="0" maxOccurs="unbounded" type="xsd:Name"/>
            <xsd:element name="NCName" minOccurs="0" maxOccurs="unbounded" type="xsd:NCName"/>
            <xsd:element name="ID" minOccurs="0" maxOccurs="unbounded" type="xsd:ID"/>
            <xsd:element name="IDREF" minOccurs="0" maxOccurs="unbounded" type="xsd:IDREF"/>
            <xsd:element name="IDREFS" minOccurs="0" maxOccurs="unbounded" type="xsd:IDREFS"/>
            <xsd:element name="integer" minOccurs="0" maxOccurs="unbounded" type="xsd:integer"/>
            <xsd:element name="nonPositiveInteger" minOccurs="0" maxOccurs="unbounded" type="xsd:nonPositiveInteger"/>
            <xsd:element name="negativeInteger" minOccurs="0" maxOccurs="unbounded" type="xsd:negativeInteger"/>
            <xsd:element name="long" minOccurs="0" maxOccurs="unbounded" type="xsd:long"/>
            <xsd:element name="int" minOccurs="0" maxOccurs="unbounded" type="xsd:int"/>
            <xsd:element name="short" minOccurs="0" maxOccurs="unbounded" type="xsd:short"/>
            <xsd:element name="byte" minOccurs="0" maxOccurs="unbounded" type="xsd:byte"/>
            <xsd:element name="nonNegativeInteger" minOccurs="0" maxOccurs="unbounded" type="xsd:nonNegativeInteger"/>
            <xsd:element name="unsignedLong" minOccurs="0" maxOccurs="unbounded" type="xsd:unsignedLong"/>
            <xsd:element name="unsignedInt" minOccurs="0" maxOccurs="unbounded" type="xsd:unsignedInt"/>
            <xsd:element name="unsignedShort" minOccurs="0" maxOccurs="unbounded" type="xsd:unsignedShort"/>
            <xsd:element name="unsignedByte" minOccurs="0" maxOccurs="unbounded" type="xsd:unsignedByte"/>
            <xsd:element name="positiveInteger" minOccurs="0" maxOccurs="unbounded" type="xsd:positiveInteger"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="testElement1" type="dtfs:TestType1"/>

    <!-- 
         elements and types for testElement2
         provides examples of deriving new types by restriction
    -->

    <xsd:simpleType name="month">
        <xsd:restriction base="xsd:int">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="12"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="status">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="unspecified"/>
            <xsd:enumeration value="Good"/>
            <xsd:enumeration value="Indifferent"/>
            <xsd:enumeration value="Bad"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="smallOddNumber">
        <xsd:restriction base="xsd:int">
            <xsd:enumeration value="1"/>
            <xsd:enumeration value="3"/>
            <xsd:enumeration value="5"/>
            <xsd:enumeration value="7"/>
            <xsd:enumeration value="9"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="oddOrEvenDigits">
        <xsd:restriction base="xsd:int">
            <xsd:pattern value="[13579]*"/>
            <xsd:pattern value="[02468]*"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="evenNumberOfOddOrEvenDigits">
        <xsd:restriction base="dtfs:oddOrEvenDigits">
            <xsd:pattern value="(..)*"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="smallBigDecimal">
        <xsd:restriction base="xsd:decimal">
            <xsd:totalDigits value="10"/>
            <xsd:fractionDigits value="2"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="smallBigInteger">
        <xsd:restriction base="xsd:integer">
            <xsd:totalDigits value="10"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="smallInt">
        <xsd:restriction base="xsd:int">
            <xsd:totalDigits value="2"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="monthList">
        <xsd:list itemType="dtfs:month"/>
    </xsd:simpleType>

    <xsd:simpleType name="statusOrMonthList">
        <xsd:union memberTypes="dtfs:status dtfs:monthList"/>
    </xsd:simpleType>

    <xsd:complexType name="Address">
        <xsd:attribute name="ip" type="xsd:ID"/>
    </xsd:complexType>

    <xsd:complexType name="Component">
        <xsd:sequence>
            <xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="from" use="required" type="xsd:IDREF"/>
        <xsd:attribute name="to" use="required" type="xsd:IDREFS"/>
        <xsd:attribute name="cc" type="xsd:IDREFS"/>
        <xsd:attribute name="bcc" type="xsd:IDREFS"/>
        <xsd:attribute name="status" type="dtfs:status"/>
    </xsd:complexType>

    <xsd:complexType name="TestType2" mixed="true">
        <xsd:sequence>
            <xsd:element name="smallBigDecimal" minOccurs="0" type="dtfs:smallBigDecimal"/>
            <xsd:element name="smallBigInteger" minOccurs="0" type="dtfs:smallBigInteger"/>
            <xsd:element name="smallInt" minOccurs="0" type="dtfs:smallInt"/>
            <xsd:element name="wierdNumber" minOccurs="0" type="dtfs:evenNumberOfOddOrEvenDigits" default="11"/>
            <xsd:element name="smallOddNumber" minOccurs="0" type="dtfs:smallOddNumber"/>
            <xsd:element name="headerValue" nillable="true" minOccurs="0" type="xsd:int"/>
            <xsd:element name="overallStatus" nillable="true" minOccurs="0" type="dtfs:status"/>
            <xsd:element name="addresses" minOccurs="1" maxOccurs="unbounded" type="dtfs:Address"/>
            <xsd:element name="components" minOccurs="1" maxOccurs="unbounded" type="dtfs:Component"/>
            <xsd:element name="item" type="xsd:IDREF"/>
            <xsd:element name="items" maxOccurs="unbounded" type="xsd:IDREF"/>
            <xsd:element name="cluster" type="xsd:IDREFS"/>
            <xsd:element name="clusters" maxOccurs="unbounded" type="xsd:IDREFS"/>
            <xsd:element name="statusOrMonthList" minOccurs="0" maxOccurs="unbounded" type="dtfs:statusOrMonthList"/>
            <xsd:element ref="dtfs:nCName" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="nCName" type="xsd:NCName"/>

    <xsd:element name="testElement2" type="dtfs:TestType2"/>

</xsd:schema>