[2674] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
| 2 | <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified" xmlns:foo="http://anothernamespace.com" > |
---|
| 3 | |
---|
| 4 | <xs:import namespace="http://www.secondSchema" schemaLocation="SecondSchema.xsd" /> |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | <xs:element name="root" type="rootType" /> |
---|
| 8 | |
---|
| 9 | <xs:complexType name="rootType" > |
---|
| 10 | <xs:sequence> |
---|
| 11 | <xs:element name="attrTest" type="attrTestType" /> |
---|
| 12 | <xs:element name="eleTest" type="eleTestType" /> |
---|
| 13 | <xs:element name="simpleDerTest" type="simpleDerTestType" /> |
---|
| 14 | <xs:element name="complexTest" type="complexTestType" /> |
---|
| 15 | <xs:element name="complexDerTest" type="complexDerTestType" /> |
---|
| 16 | <xs:element name="unionTest" type="unionTest" /> |
---|
| 17 | <xs:element name="anonymousTest" > |
---|
| 18 | <xs:complexType> |
---|
| 19 | <xs:sequence> |
---|
| 20 | <xs:element name="quantity"> |
---|
| 21 | <xs:simpleType> |
---|
| 22 | <xs:restriction base="xs:positiveInteger"> |
---|
| 23 | <xs:maxExclusive value="100"/> |
---|
| 24 | </xs:restriction> |
---|
| 25 | </xs:simpleType> |
---|
| 26 | </xs:element> |
---|
| 27 | <xs:element name='size'> |
---|
| 28 | <xs:simpleType> |
---|
| 29 | <xs:union> |
---|
| 30 | <xs:simpleType> |
---|
| 31 | <xs:restriction base='xs:integer'/> |
---|
| 32 | </xs:simpleType> |
---|
| 33 | <xs:simpleType> |
---|
| 34 | <xs:restriction base='xs:string'/> |
---|
| 35 | </xs:simpleType> |
---|
| 36 | </xs:union> |
---|
| 37 | </xs:simpleType> |
---|
| 38 | </xs:element> |
---|
| 39 | <xs:element ref="anonElement" /> |
---|
| 40 | </xs:sequence> |
---|
| 41 | <xs:attribute name="partNum" > |
---|
| 42 | <xs:simpleType> |
---|
| 43 | <xs:restriction base="xs:positiveInteger"> |
---|
| 44 | <xs:maxExclusive value="100"/> |
---|
| 45 | </xs:restriction> |
---|
| 46 | </xs:simpleType> |
---|
| 47 | </xs:attribute> |
---|
| 48 | </xs:complexType> |
---|
| 49 | </xs:element> |
---|
| 50 | <xs:element name="xsiTypeTest" type="xsiTypeTestType" /> |
---|
| 51 | <xs:element name="anyTestPartial" type="anyTestPartialType" /> |
---|
| 52 | <xs:element name="anyTest" type="anyTestType" /> |
---|
| 53 | <xs:element name="anyTestAttr1" type="anyTestAttr1Type" /> |
---|
| 54 | <xs:element name="anyTestAttr2" type="anyTestAttr2Type" /> |
---|
| 55 | <xs:element name="anyTestMissing" type="anyTestType" /> |
---|
| 56 | <xs:element name="invalidTest" type="invalidTestType" /> |
---|
| 57 | </xs:sequence> |
---|
| 58 | </xs:complexType> |
---|
| 59 | |
---|
| 60 | <xs:complexType name="anyTestPartialType" > |
---|
| 61 | <xs:sequence > |
---|
| 62 | <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip" /> |
---|
| 63 | <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax" /> |
---|
| 64 | <xs:any namespace="http://www.secondSchema" processContents="lax" /> |
---|
| 65 | </xs:sequence> |
---|
| 66 | <xs:anyAttribute namespace="http://www.w3.org/1999/xhtml" processContents="skip" /> |
---|
| 67 | </xs:complexType> |
---|
| 68 | |
---|
| 69 | <xs:complexType name="anyTestType" > |
---|
| 70 | <xs:sequence > |
---|
| 71 | <xs:any namespace="http://www.secondSchema" processContents="lax"/> |
---|
| 72 | <xs:any namespace="http://www.secondSchema" processContents="strict"/> |
---|
| 73 | <xs:any namespace="http://www.secondSchema" processContents="strict"/> |
---|
| 74 | </xs:sequence> |
---|
| 75 | <xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" /> |
---|
| 76 | </xs:complexType> |
---|
| 77 | |
---|
| 78 | <xs:complexType name="anyTestAttr1Type" > |
---|
| 79 | <xs:anyAttribute namespace="http://www.secondSchema" processContents="strict" /> |
---|
| 80 | </xs:complexType> |
---|
| 81 | |
---|
| 82 | <xs:complexType name="anyTestAttr2Type" > |
---|
| 83 | <xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" /> |
---|
| 84 | </xs:complexType> |
---|
| 85 | |
---|
| 86 | <xs:complexType name="invalidTestType" > |
---|
| 87 | <xs:sequence > |
---|
| 88 | <xs:element name="simple" type="stringDerivedType" /> |
---|
| 89 | <xs:element name="complex" type="baseComplex" /> |
---|
| 90 | <xs:element name="number" type="base" /> |
---|
| 91 | <xs:element name="complexXsi" type="baseComplex" /> |
---|
| 92 | <xs:element name="unionTest" type="uType" /> |
---|
| 93 | <xs:element name="invalidAttrTest" type="attrOnlyType" /> |
---|
| 94 | <xs:element name="missingAttrTest" type="attrOnlyType" /> |
---|
| 95 | <xs:element name="prohibitedAttrTest" type="prohibitedAttrType" /> |
---|
| 96 | </xs:sequence> |
---|
| 97 | <xs:attribute name="simple" type="stringDerivedType" /> |
---|
| 98 | </xs:complexType> |
---|
| 99 | |
---|
| 100 | |
---|
| 101 | <xs:complexType name="prohibitedAttrType" > |
---|
| 102 | <xs:attribute name="attr" type="stringDerivedType" use="prohibited" /> |
---|
| 103 | </xs:complexType> |
---|
| 104 | |
---|
| 105 | <xs:complexType name="attrOnlyType" > |
---|
| 106 | <xs:attribute name="attr" type="stringDerivedType" use="required" /> |
---|
| 107 | </xs:complexType> |
---|
| 108 | |
---|
| 109 | <xs:simpleType name="uType" > |
---|
| 110 | <xs:union memberTypes="stringDerivedType" /> |
---|
| 111 | </xs:simpleType> |
---|
| 112 | |
---|
| 113 | |
---|
| 114 | <xs:complexType name="xsiTypeTestType" > |
---|
| 115 | <xs:sequence> |
---|
| 116 | <xs:element name="number" type="base" maxOccurs="3"/> |
---|
| 117 | <xs:element name="complexXsi" type="baseComplex" maxOccurs="3"/> |
---|
| 118 | </xs:sequence> |
---|
| 119 | </xs:complexType> |
---|
| 120 | |
---|
| 121 | |
---|
| 122 | <xs:complexType name="baseComplex" > |
---|
| 123 | <xs:sequence> |
---|
| 124 | <xs:element name="a" type="xs:string" /> |
---|
| 125 | </xs:sequence> |
---|
| 126 | </xs:complexType> |
---|
| 127 | |
---|
| 128 | <xs:complexType name="level1Complex" > |
---|
| 129 | <xs:complexContent > |
---|
| 130 | <xs:extension base="baseComplex" > |
---|
| 131 | <xs:sequence> |
---|
| 132 | <xs:element name="b" type="xs:string"/> |
---|
| 133 | </xs:sequence> |
---|
| 134 | </xs:extension> |
---|
| 135 | </xs:complexContent> |
---|
| 136 | </xs:complexType> |
---|
| 137 | |
---|
| 138 | <xs:complexType name="level2Complex" > |
---|
| 139 | <xs:complexContent > |
---|
| 140 | <xs:extension base="level1Complex" > |
---|
| 141 | <xs:sequence> |
---|
| 142 | <xs:element name="c" type="xs:string"/> |
---|
| 143 | </xs:sequence> |
---|
| 144 | </xs:extension> |
---|
| 145 | </xs:complexContent> |
---|
| 146 | </xs:complexType> |
---|
| 147 | |
---|
| 148 | |
---|
| 149 | <xs:simpleType name="base" > |
---|
| 150 | <xs:restriction base="xs:decimal" > |
---|
| 151 | <xs:maxExclusive value="100"/> |
---|
| 152 | </xs:restriction> |
---|
| 153 | </xs:simpleType> |
---|
| 154 | |
---|
| 155 | <xs:simpleType name="level1" > |
---|
| 156 | <xs:restriction base="base" > |
---|
| 157 | <xs:maxExclusive value="75"/> |
---|
| 158 | </xs:restriction> |
---|
| 159 | </xs:simpleType> |
---|
| 160 | |
---|
| 161 | <xs:simpleType name="level2" > |
---|
| 162 | <xs:restriction base="level1" > |
---|
| 163 | <xs:maxExclusive value="50"/> |
---|
| 164 | </xs:restriction> |
---|
| 165 | </xs:simpleType> |
---|
| 166 | |
---|
| 167 | |
---|
| 168 | <xs:element name="anonElement" > |
---|
| 169 | <xs:simpleType > |
---|
| 170 | <xs:restriction base="xs:decimal" > |
---|
| 171 | <xs:maxExclusive value="100"/> |
---|
| 172 | </xs:restriction> |
---|
| 173 | </xs:simpleType> |
---|
| 174 | </xs:element> |
---|
| 175 | |
---|
| 176 | <xs:complexType name="eleTestType" > |
---|
| 177 | <xs:sequence > |
---|
| 178 | <xs:element name="level1string" type="xs:string" /> |
---|
| 179 | <xs:element name="level1boolean" type="xs:boolean" /> |
---|
| 180 | <xs:element name="level1decimal" type="xs:decimal" /> |
---|
| 181 | <xs:element name="level1float" type="xs:float" /> |
---|
| 182 | <xs:element name="level1double" type="xs:double" /> |
---|
| 183 | <xs:element name="level1duration" type="xs:duration" /> |
---|
| 184 | <xs:element name="level1dateTime" type="xs:dateTime" /> |
---|
| 185 | <xs:element name="level1time" type="xs:time" /> |
---|
| 186 | <xs:element name="level1date" type="xs:date" /> |
---|
| 187 | <xs:element name="level1gYearMonth" type="xs:gYearMonth" /> |
---|
| 188 | <xs:element name="level1gYear" type="xs:gYear" /> |
---|
| 189 | <xs:element name="level1gMonthDay" type="xs:gMonthDay" /> |
---|
| 190 | <xs:element name="level1gDay" type="xs:gDay" /> |
---|
| 191 | <xs:element name="level1gMonth" type="xs:gMonth" /> |
---|
| 192 | <xs:element name="level1hexBinary" type="xs:hexBinary" /> |
---|
| 193 | <xs:element name="level1base64Binary" type="xs:base64Binary" /> |
---|
| 194 | <xs:element name="level1anyURI" type="xs:anyURI" /> |
---|
| 195 | <xs:element name="level1QName" type="xs:QName" /> |
---|
| 196 | <xs:element name="level1normalizedString" type="xs:normalizedString" /> |
---|
| 197 | <xs:element name="level1token" type="xs:token" /> |
---|
| 198 | <xs:element name="level1language" type="xs:language" /> |
---|
| 199 | <xs:element name="level1NMTOKEN" type="xs:NMTOKEN" /> |
---|
| 200 | <xs:element name="level1NMTOKENS" type="xs:NMTOKENS" /> |
---|
| 201 | <xs:element name="level1Name" type="xs:Name" /> |
---|
| 202 | <xs:element name="level1NCName" type="xs:NCName" /> |
---|
| 203 | <xs:element name="level1integer" type="xs:integer" /> |
---|
| 204 | <xs:element name="level1nonPositiveInteger" type="xs:nonPositiveInteger" /> |
---|
| 205 | <xs:element name="level1negativeInteger" type="xs:negativeInteger" /> |
---|
| 206 | <xs:element name="level1long" type="xs:long" /> |
---|
| 207 | <xs:element name="level1int" type="xs:int" /> |
---|
| 208 | <xs:element name="level1short" type="xs:short" /> |
---|
| 209 | <xs:element name="level1byte" type="xs:byte" /> |
---|
| 210 | <xs:element name="level1nonNegativeInteger" type="xs:nonNegativeInteger" /> |
---|
| 211 | <xs:element name="level1unsignedLong" type="xs:unsignedLong" /> |
---|
| 212 | <xs:element name="level1unsignedInt" type="xs:unsignedInt" /> |
---|
| 213 | <xs:element name="level1unsignedShort" type="xs:unsignedShort" /> |
---|
| 214 | <xs:element name="level1unsignedByte" type="xs:unsignedByte" /> |
---|
| 215 | <xs:element name="level1positiveInteger" type="xs:positiveInteger" /> |
---|
| 216 | <xs:element name="level1anyType" type="xs:anyType" /> |
---|
| 217 | </xs:sequence> |
---|
| 218 | </xs:complexType> |
---|
| 219 | |
---|
| 220 | <xs:complexType name="attrTestType" > |
---|
| 221 | <xs:attribute name="anySimpleType" type="xs:anySimpleType" /> |
---|
| 222 | <xs:attribute name="string" type="xs:string" /> |
---|
| 223 | <xs:attribute name="boolean" type="xs:boolean" /> |
---|
| 224 | <xs:attribute name="decimal" type="xs:decimal" /> |
---|
| 225 | <xs:attribute name="float" type="xs:float" /> |
---|
| 226 | <xs:attribute name="double" type="xs:double" /> |
---|
| 227 | <xs:attribute name="duration" type="xs:duration" /> |
---|
| 228 | <xs:attribute name="dateTime" type="xs:dateTime" /> |
---|
| 229 | <xs:attribute name="time" type="xs:time" /> |
---|
| 230 | <xs:attribute name="date" type="xs:date" /> |
---|
| 231 | <xs:attribute name="gYearMonth" type="xs:gYearMonth" /> |
---|
| 232 | <xs:attribute name="gYear" type="xs:gYear" /> |
---|
| 233 | <xs:attribute name="gMonthDay" type="xs:gMonthDay" /> |
---|
| 234 | <xs:attribute name="gDay" type="xs:gDay" /> |
---|
| 235 | <xs:attribute name="gMonth" type="xs:gMonth" /> |
---|
| 236 | <xs:attribute name="hexBinary" type="xs:hexBinary" /> |
---|
| 237 | <xs:attribute name="base64Binary" type="xs:base64Binary" /> |
---|
| 238 | <xs:attribute name="anyURI" type="xs:anyURI" /> |
---|
| 239 | <xs:attribute name="QName" type="xs:QName" /> |
---|
| 240 | <xs:attribute name="normalizedString" type="xs:normalizedString" /> |
---|
| 241 | <xs:attribute name="token" type="xs:token" /> |
---|
| 242 | <xs:attribute name="language" type="xs:language" /> |
---|
| 243 | <xs:attribute name="NMTOKEN" type="xs:NMTOKEN" /> |
---|
| 244 | <xs:attribute name="NMTOKENS" type="xs:NMTOKENS" /> |
---|
| 245 | <xs:attribute name="Name" type="xs:Name" /> |
---|
| 246 | <xs:attribute name="NCName" type="xs:NCName" /> |
---|
| 247 | <xs:attribute name="ID" type="xs:ID" /> |
---|
| 248 | <xs:attribute name="IDREF" type="xs:IDREF" /> |
---|
| 249 | <xs:attribute name="IDREFS" type="xs:IDREFS" /> |
---|
| 250 | <xs:attribute name="ENTITY" type="xs:ENTITY" /> |
---|
| 251 | <xs:attribute name="ENTITIES" type="xs:ENTITIES" /> |
---|
| 252 | <xs:attribute name="integer" type="xs:integer" /> |
---|
| 253 | <xs:attribute name="nonPositiveInteger" type="xs:nonPositiveInteger" /> |
---|
| 254 | <xs:attribute name="negativeInteger" type="xs:negativeInteger" /> |
---|
| 255 | <xs:attribute name="long" type="xs:long" /> |
---|
| 256 | <xs:attribute name="int" type="xs:int" /> |
---|
| 257 | <xs:attribute name="short" type="xs:short" /> |
---|
| 258 | <xs:attribute name="byte" type="xs:byte" /> |
---|
| 259 | <xs:attribute name="nonNegativeInteger" type="xs:nonNegativeInteger" /> |
---|
| 260 | <xs:attribute name="unsignedLong" type="xs:unsignedLong" /> |
---|
| 261 | <xs:attribute name="unsignedInt" type="xs:unsignedInt" /> |
---|
| 262 | <xs:attribute name="unsignedShort" type="xs:unsignedShort" /> |
---|
| 263 | <xs:attribute name="unsignedByte" type="xs:unsignedByte" /> |
---|
| 264 | <xs:attribute name="positiveInteger" type="xs:positiveInteger" /> |
---|
| 265 | <xs:attribute name="defaultString" type="xs:string" default="hello" /> |
---|
| 266 | <xs:attribute name="defaultInt" type="xs:integer" default="12" /> |
---|
| 267 | </xs:complexType> |
---|
| 268 | |
---|
| 269 | <xs:complexType name="simpleDerTestType" > |
---|
| 270 | <xs:sequence> |
---|
| 271 | <xs:element name="decimalDerived" type="decimalDerivedType" /> |
---|
| 272 | <xs:element name="stringDerived" type="stringDerivedType" /> |
---|
| 273 | </xs:sequence> |
---|
| 274 | <xs:attribute name="decimalDerived" type="decimalDerivedType" /> |
---|
| 275 | <xs:attribute name="stringDerived" type="stringDerivedType" /> |
---|
| 276 | </xs:complexType> |
---|
| 277 | |
---|
| 278 | <xs:simpleType name="stringDerivedType" > |
---|
| 279 | <xs:restriction base="xs:string" > |
---|
| 280 | <xs:pattern value="hello"/> |
---|
| 281 | </xs:restriction> |
---|
| 282 | </xs:simpleType> |
---|
| 283 | |
---|
| 284 | <xs:simpleType name="decimalDerivedType" > |
---|
| 285 | <xs:restriction base="xs:decimal" > |
---|
| 286 | <xs:maxExclusive value="100"/> |
---|
| 287 | </xs:restriction> |
---|
| 288 | </xs:simpleType> |
---|
| 289 | |
---|
| 290 | <xs:complexType name="complexTestType" > |
---|
| 291 | <xs:sequence> |
---|
| 292 | <xs:element name="a" type="xs:string"/> |
---|
| 293 | <xs:element name="b" type="stringDerivedType"/> |
---|
| 294 | <xs:element name="c" type="decimalDerivedType"/> |
---|
| 295 | </xs:sequence> |
---|
| 296 | <xs:attribute name="a" type="xs:string" /> |
---|
| 297 | <xs:attribute name="b" type="stringDerivedType" /> |
---|
| 298 | <xs:attribute name="c" type="decimalDerivedType" /> |
---|
| 299 | </xs:complexType> |
---|
| 300 | |
---|
| 301 | <xs:complexType name="complexDerTestType" > |
---|
| 302 | <xs:complexContent > |
---|
| 303 | <xs:extension base="complexTestType" > |
---|
| 304 | <xs:sequence> |
---|
| 305 | <xs:element name="d" type="xs:string"/> |
---|
| 306 | </xs:sequence> |
---|
| 307 | </xs:extension> |
---|
| 308 | </xs:complexContent> |
---|
| 309 | </xs:complexType> |
---|
| 310 | |
---|
| 311 | <xs:simpleType name="unionTestType" > |
---|
| 312 | <xs:union memberTypes="decimalDerivedType stringDerivedType xs:decimal xs:string" /> |
---|
| 313 | </xs:simpleType> |
---|
| 314 | |
---|
| 315 | |
---|
| 316 | <xs:complexType name="unionTest" > |
---|
| 317 | <xs:sequence > |
---|
| 318 | <xs:element name="testEle" maxOccurs="4" type="unionTestType" /> |
---|
| 319 | <xs:element name="testEle2" maxOccurs="4" > |
---|
| 320 | <xs:complexType > |
---|
| 321 | <xs:attribute name="testAttr" type="unionTestType" /> |
---|
| 322 | <xs:attribute name="testAttr2" type="unionTestType" /> |
---|
| 323 | </xs:complexType> |
---|
| 324 | </xs:element> |
---|
| 325 | </xs:sequence> |
---|
| 326 | </xs:complexType> |
---|
| 327 | |
---|
| 328 | <xs:complexType name="unionTest2" > |
---|
| 329 | <xs:sequence > |
---|
| 330 | <xs:element name="testEle" maxOccurs="4" > |
---|
| 331 | <xs:complexType > |
---|
| 332 | <xs:simpleContent > |
---|
| 333 | <xs:extension base="unionTestType" > |
---|
| 334 | <xs:attribute name="testAttr" type="unionTestType" /> |
---|
| 335 | </xs:extension > |
---|
| 336 | </xs:simpleContent> |
---|
| 337 | </xs:complexType> |
---|
| 338 | </xs:element> |
---|
| 339 | </xs:sequence> |
---|
| 340 | </xs:complexType> |
---|
| 341 | |
---|
| 342 | <xs:complexType name="testtype2" > |
---|
| 343 | <xs:sequence> |
---|
| 344 | <xs:element name="poo" type="xs:string"/> |
---|
| 345 | </xs:sequence> |
---|
| 346 | <xs:attribute name="a" type="xs:IDREF" /> |
---|
| 347 | <xs:attribute name="b" type="xs:ID" /> |
---|
| 348 | <xs:attribute name="c" type="xs:string" /> |
---|
| 349 | |
---|
| 350 | </xs:complexType> |
---|
| 351 | |
---|
| 352 | </xs:schema> |
---|