XML Schemas - Lexical Records

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:lx="http://umlslex.nlm.nih.gov/lexicon">
                                                                                
<xsd:element name="lexRecords" type="lexRecordsType"/>
                                                                                
<!-- lexicon, lexRecords -->
<xsd:complexType name="lexRecordsType">
    <xsd:sequence>
        <xsd:element name="lexRecord" type="lexRecordType" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
</xsd:complexType>
                                                                                
<!-- lexRecordType -->
<xsd:complexType name="lexRecordType">
    <xsd:sequence>
        <xsd:element name="base" type="xsd:string" minOccurs="1" maxOccurs="1"/>        
        <xsd:element name="eui" type="euiType" minOccurs="1" maxOccurs="1"/>
        <xsd:element name="cat" type="catType" minOccurs="1" maxOccurs="1"/>
        <xsd:element name="spellingVars" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="inflVars" type="inflVarsType" minOccurs="1" maxOccurs="unbounded"/>
        <xsd:group ref="catEntryType"  minOccurs="0" maxOccurs="1"/>
        <xsd:element name="acronyms" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="abbreviations" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="classTypes" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="annotations" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="signature" type="xsd:string" minOccurs="0" maxOccurs="1"/>
    </xsd:sequence>
</xsd:complexType>

<!-- eui type -->
<xsd:simpleType name="euiType">
    <xsd:restriction base="xsd:string">
        <xsd:pattern value="[E]{1}[0-9]{7}"/>
    </xsd:restriction>
</xsd:simpleType>

<!-- cat type -->
<xsd:simpleType name="catType">
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="adj"/>
        <xsd:enumeration value="adv"/>
        <xsd:enumeration value="aux"/>
        <xsd:enumeration value="compl"/>
        <xsd:enumeration value="conj"/>
        <xsd:enumeration value="det"/>
        <xsd:enumeration value="modal"/>
        <xsd:enumeration value="noun"/>
        <xsd:enumeration value="prep"/>
        <xsd:enumeration value="pron"/>
        <xsd:enumeration value="verb"/>
    </xsd:restriction>
</xsd:simpleType>

<!-- inflVars type -->
<xsd:complexType name="inflVarsType">
    <xsd:simpleContent>
        <xsd:extension base="xsd:string">
        <xsd:attribute name="cat" type="catType" use="required"/>
        <xsd:attribute name="cit" type="xsd:string" use="required"/>
        <xsd:attribute name="eui" type="euiType" use="required"/>
        <xsd:attribute name="infl" type="inflType" use="required"/>
        <xsd:attribute name="type" type="inflTypeType" use="required"/>
        <xsd:attribute name="unInfl" type="xsd:string" use="required"/>
        </xsd:extension>
    </xsd:simpleContent>
</xsd:complexType>

<!-- infl Type -->
<xsd:simpleType name="inflType">
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="base"/>
        <xsd:enumeration value="comparative"/>
        <xsd:enumeration value="infinitive"/>
        <xsd:enumeration value="past"/>
        <xsd:enumeration value="past1p23p"/>
        <xsd:enumeration value="past1p23pNeg"/>
        <xsd:enumeration value="past1s3s"/>
        <xsd:enumeration value="past1s3sNeg"/>
        <xsd:enumeration value="pastNeg"/>
        <xsd:enumeration value="pastPart"/>
        <xsd:enumeration value="plural"/>
        <xsd:enumeration value="positive"/>
        <xsd:enumeration value="pres"/>
        <xsd:enumeration value="pres123p"/>
        <xsd:enumeration value="pres123pNeg"/>
        <xsd:enumeration value="pres1p23p"/>
        <xsd:enumeration value="pres1p23pNeg"/>
        <xsd:enumeration value="pres1s"/>
        <xsd:enumeration value="pres3s"/>
        <xsd:enumeration value="pres3sNeg"/>
        <xsd:enumeration value="presNeg"/>
        <xsd:enumeration value="presPart"/>
        <xsd:enumeration value="singular"/>
        <xsd:enumeration value="superlative"/>
    </xsd:restriction>
</xsd:simpleType>

<!-- type Type -->
<xsd:simpleType name="inflTypeType">
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="basic"/>
        <xsd:enumeration value="glreg"/>
        <xsd:enumeration value="group(glreg)"/>
        <xsd:enumeration value="group(irreg)"/>
        <xsd:enumeration value="group(reg)"/>
        <xsd:enumeration value="group(sing)"/>
        <xsd:enumeration value="groupuncount"/>
        <xsd:enumeration value="inv"/>
        <xsd:enumeration value="irreg"/>
        <xsd:enumeration value="metareg"/>
        <xsd:enumeration value="plur"/>
        <xsd:enumeration value="reg"/>
        <xsd:enumeration value="regd"/>

        <xsd:enumeration value="free"/>
        <xsd:enumeration value="fstPlur"/>
        <xsd:enumeration value="fstSing"/>
        <xsd:enumeration value="group(metareg)"/>
        <xsd:enumeration value="invPeriph"/>
        <xsd:enumeration value="plurUncount"/>
        <xsd:enumeration value="second"/>
        <xsd:enumeration value="secPlur"/>
        <xsd:enumeration value="secSing"/>
        <xsd:enumeration value="sing"/>
        <xsd:enumeration value="singUncount"/>
        <xsd:enumeration value="third"/>
        <xsd:enumeration value="thrPlur"/>
        <xsd:enumeration value="thrSing"/>
        <xsd:enumeration value="uncount"/>
    </xsd:restriction>
</xsd:simpleType>

<!-- catEntry type: -->
<xsd:group name="catEntryType">
    <xsd:choice>
        <xsd:element name="adjEntry" type="adjEntryType"/>
        <xsd:element name="advEntry" type="advEntryType"/>
        <xsd:element name="auxEntry" type="auxEntryType"/>
        <xsd:element name="detEntry" type="detEntryType"/>
        <xsd:element name="modalEntry" type="modalEntryType"/>
        <xsd:element name="nounEntry" type="nounEntryType"/>
        <xsd:element name="pronEntry" type="pronEntryType"/>
        <xsd:element name="verbEntry" type="verbEntryType"/>
    </xsd:choice>
</xsd:group>

</xsd:schema>