<!--
 Copyright (c) 2000-2025 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
  Raduly, Csaba
  Szabo, Bence Janos
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:strng=    "http://www.XmlTest.org/string"
            targetNamespace="http://www.XmlTest.org/string">

<xsd:annotation>
  <xsd:documentation xml:lang="en">
    This documentum tests based on
    XML Schema Part 0: Primer Second Edition,
    2.3 Simple Types and
    Appendix B
    XML Schema Part 2: Datatypes Second Edition
    3 Built-in Datatypes
  </xsd:documentation>
</xsd:annotation>

<xsd:element name="NameA" type="strng:Name"/>

<xsd:simpleType name="Name">
  <xsd:restriction base="xsd:string">
  </xsd:restriction>
</xsd:simpleType>

<xsd:element name="nameB" type="strng:name"/>

<xsd:simpleType name="name">
  <xsd:restriction base="xsd:string">
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="NameLength4" >
  <xsd:restriction base="xsd:string">
    <xsd:length value="4" fixed="true"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:element name="Non-empty-string" type="strng:Non-empty-string"/>

<xsd:simpleType name='Non-empty-string'>
  <xsd:restriction base='xsd:string' >
    <xsd:length value='3' fixed="false"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name='Non-empty-stringChild'>
  <xsd:restriction base='strng:Non-empty-string'>
    <xsd:length value='3'/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name='Longer-string'>
  <xsd:restriction base='xsd:string'>
    <xsd:length value='5'/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name='Longer-stringChild'>
  <xsd:restriction base='strng:Longer-string'>
    <xsd:length value='5'/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name='StringMin'>
  <xsd:restriction base='xsd:string'>
    <xsd:minLength value='5'/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name='StringMax'>
  <xsd:restriction base='xsd:string'>
    <xsd:maxLength value='7'/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name='StringMinMax'>
  <xsd:restriction base='xsd:string'>
    <xsd:minLength value='5'/>
    <xsd:maxLength value='7'/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name='better-us-zipcode'>
  <xsd:restriction base='xsd:string'>
    <xsd:pattern value='[0-9]{5}(-[0-9]{4})?'/>
  </xsd:restriction>
</xsd:simpleType>

<!-- [$\c]+ means: (dollar or NameChar) 1 or more times.
  \c inside a character class gets "folded into" it.
  It should become:      (pattern "dollar-or-namechar`s=[$\w\d.\-_:]+") -->
<xsd:simpleType name='HO47449a'>
  <xsd:restriction base='xsd:string'>
    <xsd:pattern            value='dollar-or-namechar`s=[$\c]+'/>
  </xsd:restriction>
</xsd:simpleType>

<!-- [\]$\c\[]+ means: (] or $ or NameChar or [) 1 or more times.
  \c is still inside a character class.
  It should become:      (pattern "still-inside=[\]$\w\d.\-_:\[]+") -->
<xsd:simpleType name='HO47449b'>
  <xsd:restriction base='xsd:string'>
    <xsd:pattern            value='still-inside=[\]$\c\[]+'/>
  </xsd:restriction>
</xsd:simpleType>

<!-- [ ]$\c[ ]+ means: space,
   followed by dollar, a NameChar,
   and another space 1 or more times.
   This time, \c is outside the character class.
   It should become:     (pattern "outside=[ ]$[\w\d.\-_:][ ]+") -->
<xsd:simpleType name='HO47449c'>
  <xsd:restriction base='xsd:string'>
    <xsd:pattern value='outside=[ ]$\c[ ]+'/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name='artf673083'>
  <xsd:restriction base='xsd:string'>
    <xsd:pattern value='(&quot;\i\c*&quot;)'/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name='mystring'>
  <xsd:restriction base='xsd:string'>
    <xsd:minLength value='4'/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:annotation>
    <xsd:documentation xml:lang="en">
      Case Sensitivity Test follows: Mystring and mystring should be different
    </xsd:documentation>
</xsd:annotation>

<xsd:simpleType name='Mystring'>
  <xsd:restriction base='xsd:string'>
    <xsd:minLength value='4'/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:element name="type" type="strng:type"/>

<xsd:simpleType name='type'>
  <xsd:restriction base='xsd:string'>
  </xsd:restriction>
</xsd:simpleType>

</xsd:schema>
