<!--
 Copyright (c) 2000-2021 Ericsson Telecom AB
 All rights reserved. This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v2.0
 which accompanies this distribution, and is available at
 https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html

 Contributors:
  Balasko, Jeno
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema"
            xmlns:n="www.XmlTest.org/negativeTest_XML_Types"
            targetNamespace="www.XmlTest.org/negativeTest_XML_Types">
  <annotation>
    <documentation xml:lang="en">
      This documentum tests based on
      XML Schema Part 1: Structures Second Edition
      Last modified: 2011-04-13, ETHBAAT
    </documentation>
  </annotation>

<simpleType name="b">
  <restriction base="boolean"/>
</simpleType>

<simpleType name="i">
  <restriction base="integer"/>
</simpleType>

<simpleType name="j">
  <restriction base="integer"/>
</simpleType>

<simpleType name="k">
  <restriction base="integer"/>
</simpleType>

<simpleType name="e">
  <restriction base="n:MyEnum"/>
</simpleType>

<simpleType name="n">
  <restriction base="n:NULL"/>
</simpleType>

<simpleType name="f">
  <restriction base="float"/>
</simpleType>

<simpleType name="r">
  <restriction base="float"/>
</simpleType>

<simpleType name="FLOAT">
  <restriction base="float"/>
</simpleType>

<simpleType name="x">
  <restriction base="float"/>
</simpleType>

<simpleType name="y">
  <restriction base="float"/>
</simpleType>

<simpleType name="o">
  <restriction base="n:octetstring"/>
</simpleType>

<simpleType name="s">
  <restriction base="string"/>
</simpleType>

<!-- 0. elementary -->

<simpleType name="MyEnum">
  <restriction base="string">
  <enumeration value="first"/>
  <enumeration value="second"/>
  <enumeration value="third"/>
  </restriction>
</simpleType>

<simpleType name="NULL">
  <restriction base="string">
    <enumeration value="NULL"/>
  </restriction>
</simpleType>
<!-- 1. Sequence (record_ -->

<complexType name="MySeqEmpty">
  <sequence>
  </sequence>
</complexType>

<complexType name="MySeqBool">
  <sequence>
    <element name="b" type="boolean"/>
  </sequence>
</complexType>

<complexType name="MySeqNull">
  <sequence>
    <element name="n" type="n:NULL"/>
  </sequence>
</complexType>

<complexType name="MySeqInt">
  <sequence>
    <element name="i" type="integer"/>
  </sequence>
</complexType>

<complexType name="MySeqMyEnum">
  <sequence>
    <element name="e" type="n:MyEnum"/>
  </sequence>
</complexType>

<complexType name="MySeqInt2">
  <sequence>
    <element name="i" type="n:i"/>
    <element name="j" type="n:j"/>
  </sequence>
</complexType>

<complexType name="MySeqInt2opt">
  <sequence>
    <element name="i" type="integer"/>
    <element name="j" type="integer" minOccurs="0"/>
  </sequence>
</complexType>

<complexType name="MySeqIntSeqInt2">
  <sequence>
    <element name="i" type="integer"/>
    <element name="jk" type="n:MySeqInt2"/>
  </sequence>
</complexType>

<complexType name="MySeqIntSeqInt2opt">
  <sequence>
    <element name="i" type="integer" minOccurs="0"/>
    <element name="jk" type="n:MySeqInt2"/>
  </sequence>
</complexType>

<complexType name="MySeqIntSeqInt2optopt">
  <sequence>
    <element name="i" type="integer" minOccurs="0"/>
    <element name="jk" type="n:MySeqInt2opt"/>
  </sequence>
</complexType>

<complexType name="MySeqInt3">
  <sequence>
    <element name="i" type="integer"/>
    <element name="j" type="integer"/>
    <element name="k" type="integer"/>
  </sequence>
</complexType>

<complexType name="MySeqInt3opt">
  <sequence>
    <element name="i" type="integer"/>
    <element name="j" type="integer"/>
    <element name="k" type="integer" minOccurs="0"/>
  </sequence>
</complexType>

<complexType name="MySeqInt4">
  <sequence>
    <element name="i" type="integer"/>
    <element name="j" type="integer"/>
    <element name="k" type="integer"/>
    <element name="l" type="integer"/>
  </sequence>
</complexType>

<complexType name="MySeqInt4opt">
  <sequence>
    <element name="i" type="integer"/>
    <element name="j" type="integer"/>
    <element name="k" type="integer"/>
    <element name="l" type="integer" minOccurs="0"/>
  </sequence>
</complexType>

<complexType name="MySeqReal">
  <sequence>
    <element name="x" type="float"/>
  </sequence>
</complexType>

<complexType name="MySeqReal2">
  <sequence>
    <element name="x" type="float"/>
    <element name="y" type="float"/>
  </sequence>
</complexType>

<complexType name="MySeqStr">
  <sequence>
    <element name="s" type="string"/>
  </sequence>
</complexType>

<complexType name="MySeqStr2">
  <sequence>
    <element name="s" type="string"/>
    <element name="t" type="string"/>
  </sequence>
</complexType>

<!-- there is no such thing as a bitstring  -->
<element name="bitstring" type="decimal"/>

<complexType name="MySeqBitStr">
  <sequence>
    <element name="b" type="n:bitstring"/>
  </sequence>
</complexType>

<complexType name="MySeqBitStr2">
  <sequence>
    <element name="a" type="n:bitstring"/>
    <element name="b" type="n:bitstring"/>
  </sequence>
</complexType>

<complexType name="MySeqIntReal">
  <sequence>
    <element name="i" type="integer"/>
    <element name="x" type="float"/>
  </sequence>
</complexType>

<complexType name="MySeqIntStr">
  <sequence>
    <element name="i" type="integer"/>
    <element name="s" type="string"/>
  </sequence>
</complexType>

<complexType name="MySeqIntBitStr">
  <sequence>
    <element name="i" type="integer"/>
    <element name="b" type="n:bitstring"/>
  </sequence>
</complexType>

<!-- there is no such thing as an octetstring, Double tested instead -->
<element name="octetstring" type="date"/>

<complexType name="MySeqOctStr">
  <sequence>
    <element name="o" type="n:octetstring"/>
  </sequence>
</complexType>

<complexType name="MySeqOJKL">
  <sequence>
    <element name="o" type="n:octetstring"/>
    <element name="j" type="integer"/>
    <element name="k" type="integer"/>
    <element name="l" type="integer"/>
  </sequence>
</complexType>

<complexType name="MySeqIOKL">
  <sequence>
    <element name="i" type="integer"/>
    <element name="o" type="n:octetstring"/>
    <element name="k" type="n:integer"/>
    <element name="l" type="n:integer"/>
  </sequence>
</complexType>

<complexType name="MySeqISKL">
  <sequence>
    <element name="i" type="integer"/>
    <element name="s" type="n:MySeqInt4"/>
    <element name="k" type="integer"/>
    <element name="l" type="integer"/>
  </sequence>
</complexType>



<!-- ===== sequence of sequence of sequence ==== -->
<complexType name="MySeqIntSeqIntSeqInt2SeqReal2">
  <sequence>
    <element name="i" type="integer" minOccurs="0"/>
    <element name="jkl" type="n:MySeqIntSeqInt2"/>
    <element name="xy" type="n:MySeqReal2"/>
  </sequence>
</complexType>

<complexType name="MySeqIntSeqIntSeqInt2optoptSeqReal2">
  <sequence>
    <element name="i" type="integer" minOccurs="0"/>
    <element name="jkl" type="n:MySeqIntSeqInt2optopt"/>
    <element name="xy" type="n:MySeqReal2"/>
  </sequence>
</complexType>

<complexType name="MySeqIntSeqReal2">
  <sequence>
    <element name="i" type="integer" minOccurs="0"/>
    <element name="xy" type="n:MySeqReal2"/>
  </sequence>
</complexType>

<complexType name="MySeqIntSeqIntSeqInt2">
  <sequence>
    <element name="i" type="integer"/>
    <element name="jkl" type="n:MySeqIntSeqInt2"/>
  </sequence>
</complexType>

<complexType name="MySeqSeqIntSeqInt2SeqReal2">
  <sequence>
    <element name="jkl" type="n:MySeqIntSeqInt2"/>
    <element name="xy" type="n:MySeqReal2"/>
  </sequence>
</complexType>

<complexType name="MySeq_SeqSeqIntSeqInt2SeqReal2_SeqSeqIntSeqInt2SeqReal2">
  <sequence>
    <element name="s1" type="n:MySeqSeqIntSeqInt2SeqReal2"/>
    <element name="s2" type="n:MySeqSeqIntSeqInt2SeqReal2"/>
  </sequence>
</complexType>

<complexType name="MySeq_SeqSeqIntSeqInt2optoptSeqReal2_SeqSeqIntSeqInt2optoptSeqReal2">
  <sequence>
    <element name="s1" type="n:MySeqIntSeqIntSeqInt2optoptSeqReal2"/>
    <element name="s2" type="n:MySeqIntSeqIntSeqInt2optoptSeqReal2"/>
  </sequence>
</complexType>

<complexType name="MySeqBasicTypes">
  <sequence>
    <element name="b" type="boolean"/>
    <element name="n" type="n:NULL"/>
    <element name="i" type="integer"/>
    <element name="e" type="n:MyEnum"/>
    <element name="r" type="float"/>
    <element name="bs" type="n:bitstring"/>
    <element name="os" type="n:octetstring"/>
    <element name="oi" type="string"/>
    <element name="roi" type="string"/>
  </sequence>
</complexType>

<complexType name="MySeqEnum">
  <sequence>
    <element name="e" type="n:MyEnum"/>
  </sequence>
</complexType>

<!-- 2. Sequence of (record of)-->

<complexType name="MySeqOfBool">
  <sequence>
    <element name="b" type="boolean" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfNull">
  <sequence>
    <element name="n" type="n:NULL" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfInt">
  <sequence>
    <element name="i" type="integer" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfMyEnum">
  <sequence>
    <element name="e" type="n:MyEnum" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfEnum">
  <sequence>
    <element name="e" type="n:MyEnum" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfReal">
  <sequence>
    <element name="r" type="float" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfBitStr">
  <sequence>
    <element name="bs" type="n:bitstring" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfOctStr">
  <sequence>
    <element name="os" type="n:octetstring" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfObjId">
  <sequence>
    <element name="oi" type="string" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfMyUnionBT">
  <sequence>
    <element name="u" type="n:MyUnionBasicTypes" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfSeqSeqIntSeqInt2SeqReal2">
  <sequence>
    <element name="s" type="n:MySeqSeqIntSeqInt2SeqReal2" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<complexType name="MySeqOfMySeqIntSeqIntSeqInt2optoptSeqReal2">
  <sequence>
    <element name="s" type="n:MySeqIntSeqIntSeqInt2optoptSeqReal2" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>


<!-- 3. Set -->


<complexType name="MySetBool">
  <all>
    <element name="b" type="boolean"/>
  </all>
</complexType>

<complexType name="MySetNull">
  <all>
    <element name="n" type="n:NULL"/>
  </all>
</complexType>

<complexType name="MySetInt">
  <all>
    <element name="i" type="integer"/>
  </all>
</complexType>

<complexType name="MySetMyEnum">
  <all>
    <element name="e" type="n:MyEnum"/>
  </all>
</complexType>

<complexType name="MySetInt2">
  <all>
    <element name="i" type="n:i"/>
    <element name="j" type="n:j"/>
  </all>
</complexType>

<complexType name="MySetInt2opt">
  <all>
    <element name="i" type="integer"/>
    <element name="j" type="integer" minOccurs="0"/>
  </all>
</complexType>

<complexType name="MySetIntSetInt2">
  <all>
    <element name="i" type="integer"/>
    <element name="jk" type="n:MySetInt2"/>
  </all>
</complexType>

<complexType name="MySetIntSetInt2opt">
  <all>
    <element name="i" type="integer" minOccurs="0"/>
    <element name="jk" type="n:MySetInt2"/>
  </all>
</complexType>

<complexType name="MySetIntSetInt2optopt">
  <all>
    <element name="i" type="integer" minOccurs="0"/>
    <element name="jk" type="n:MySetInt2opt"/>
  </all>
</complexType>

<complexType name="MySetInt3">
  <all>
    <element name="i" type="integer"/>
    <element name="j" type="integer"/>
    <element name="k" type="integer"/>
  </all>
</complexType>

<complexType name="MySetInt3opt">
  <all>
    <element name="i" type="integer"/>
    <element name="j" type="integer"/>
    <element name="k" type="integer" minOccurs="0"/>
  </all>
</complexType>

<complexType name="MySetInt4">
  <all>
    <element name="i" type="integer"/>
    <element name="j" type="integer"/>
    <element name="k" type="integer"/>
    <element name="l" type="integer"/>
  </all>
</complexType>

<complexType name="MySetInt4opt">
  <all>
    <element name="i" type="integer"/>
    <element name="j" type="integer"/>
    <element name="k" type="integer"/>
    <element name="l" type="integer" minOccurs="0"/>
  </all>
</complexType>

<complexType name="MySetReal">
  <all>
    <element name="x" type="float"/>
  </all>
</complexType>

<complexType name="MySetReal2">
  <all>
    <element name="x" type="float"/>
    <element name="y" type="float"/>
  </all>
</complexType>

<complexType name="MySetStr">
  <all>
    <element name="s" type="string"/>
  </all>
</complexType>

<complexType name="MySetStr2">
  <all>
    <element name="s" type="string"/>
    <element name="t" type="string"/>
  </all>
</complexType>

<!-- there is no such thing as a bitstring  -->

<complexType name="MySetBitStr">
  <all>
    <element name="b" type="n:bitstring"/>
  </all>
</complexType>

<complexType name="MySetBitStr2">
  <all>
    <element name="a" type="n:bitstring"/>
    <element name="b" type="n:bitstring"/>
  </all>
</complexType>

<complexType name="MySetIntReal">
  <all>
    <element name="i" type="integer"/>
    <element name="x" type="float"/>
  </all>
</complexType>

<complexType name="MySetIntStr">
  <all>
    <element name="i" type="integer"/>
    <element name="s" type="string"/>
  </all>
</complexType>

<complexType name="MySetIntBitStr">
  <all>
    <element name="i" type="integer"/>
    <element name="b" type="n:bitstring"/>
  </all>
</complexType>

<!-- there is no such thing as an octetstring, Double tested instead -->

<complexType name="MySetOctStr">
  <all>
    <element name="o" type="n:octetstring"/>
  </all>
</complexType>

<complexType name="MySetOJKL">
  <all>
    <element name="o" type="n:octetstring"/>
    <element name="j" type="integer"/>
    <element name="k" type="integer"/>
    <element name="l" type="integer"/>
  </all>
</complexType>

<complexType name="MySetIOKL">
  <all>
    <element name="i" type="integer"/>
    <element name="o" type="n:octetstring"/>
    <element name="k" type="n:integer"/>
    <element name="l" type="n:integer"/>
  </all>
</complexType>

<complexType name="MySetIOSKL">
  <all>
    <element name="i" type="integer"/>
    <element name="o" type="n:octetstring"/>
    <element name="s" type="n:MySetInt4"/>
    <element name="k" type="n:integer"/>
    <element name="l" type="n:integer"/>
  </all>
</complexType>

<complexType name="MySetISKL">
  <all>
    <element name="i" type="integer"/>
    <element name="s" type="n:MySetInt4"/>
    <element name="k" type="integer"/>
    <element name="l" type="integer"/>
  </all>
</complexType>


<complexType name="MySetISOKL">
  <all>
    <element name="i" type="integer"/>
    <element name="s" type="n:MySetInt4"/>
    <element name="o" type="n:octetstring"/>
    <element name="k" type="integer"/>
    <element name="l" type="integer"/>
  </all>
</complexType>

<!-- ===== all of all of all ==== -->
<complexType name="MySetIntSetIntSetInt2SetReal2">
  <all>
    <element name="i" type="integer" minOccurs="0"/>
    <element name="jkl" type="n:MySetIntSetInt2"/>
    <element name="xy" type="n:MySetReal2"/>
  </all>
</complexType>

<complexType name="MySetIntSeqIntSeqInt2optoptSeqReal2">
  <all>
    <element name="i" type="integer" minOccurs="0"/>
    <element name="jkl" type="n:MySetIntSetInt2optopt"/>
    <element name="xy" type="n:MySetReal2"/>
  </all>
</complexType>

<complexType name="MySetIntSeqReal2">
  <all>
    <element name="i" type="integer" minOccurs="0"/>
    <element name="xy" type="n:MySetReal2"/>
  </all>
</complexType>

<complexType name="MySetIntSeqIntSeqInt2">
  <all>
    <element name="i" type="integer"/>
    <element name="jkl" type="n:MySetIntSetInt2"/>
  </all>
</complexType>

<complexType name="MySetSetIntSetInt2SetReal2">
  <all>
    <element name="jkl" type="n:MySetIntSetInt2"/>
    <element name="xy" type="n:MySetReal2"/>
  </all>
</complexType>

<complexType name="MySet_SetSetIntSetInt2SetReal2_SetSetIntSetInt2SetReal2">
  <all>
    <element name="s1" type="n:MySetSetIntSetInt2SetReal2"/>
    <element name="s2" type="n:MySetSetIntSetInt2SetReal2"/>
  </all>
</complexType>

<complexType name="MySetBasicTypes">
  <all>
    <element name="b" type="boolean"/>
    <element name="n" type="n:NULL"/>
    <element name="i" type="integer"/>
    <element name="e" type="n:MyEnum"/>
    <element name="r" type="float"/>
    <element name="bs" type="n:bitstring"/>
    <element name="os" type="n:octetstring"/>
    <element name="oi" type="string"/>
    <element name="roi" type="string"/>
  </all>
</complexType>

<complexType name="MySetEnum">
  <all>
    <element name="e" type="n:MyEnum"/>
  </all>
</complexType>


<!-- 4. Set of -->


<!-- 5. Union  -->
<complexType name="MyUnionBasicTypes">
  <choice>
    <element name="b" type="boolean"/>
    <element name="n" type="n:NULL"/>
    <element name="i" type="integer"/>
    <element name="e" type="n:MyEnum"/>
    <element name="r" type="float"/>
    <element name="bs" type="n:bitstring"/>
    <element name="os" type="n:octetstring"/>
    <element name="oi" type="string"/>
  </choice>
</complexType>

<complexType name="MyUnionComplexTypes">
  <choice>
    <element name="u" type="n:MyUnionBasicTypes"/>
    <element name="sofreal" type="n:MySeqOfReal"/>
  </choice>
</complexType>

<element name="MyUnionElement" type="n:MyUnionBasicTypes"/>

<!-- 5. Attribute  -->
<simpleType name="myAttr">
  <restriction base="boolean"/>
</simpleType>

<element name="internationalPrice">
 <complexType>
   <sequence>
     <element name="myUnionValue" type="n:MyUnionBasicTypes" minOccurs="0"/>
   </sequence>
   <attribute name="currency" type="string"/>
   <attribute name="value" type="decimal"/>
 </complexType>
</element>

</schema>
