<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="text_unit">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="hanmun_text" maxOccurs="unbounded">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="punctuation_scheme" type="xs:string" use="required"/>
                <xs:attribute name="model" type="xs:string" use="optional"/>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>

        <xs:element name="glossary">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="term" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="lemma">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="hanmun" type="xs:string"/>
                          <xs:element name="korean" type="xs:string"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="sense">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="definition" type="xs:string"/>
                          <xs:element name="sense_note" type="xs:string" minOccurs="0"/>
                        </xs:sequence>
                        <xs:attribute name="scope" type="xs:string" use="required"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="type" type="xs:string" use="required"/>
                  <xs:attribute name="id" type="xs:string" use="optional"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="status" type="xs:string" use="optional"/>
            <xs:attribute name="model" type="xs:string" use="optional"/>
          </xs:complexType>
        </xs:element>

        <xs:element name="translation">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="lang" type="xs:string" use="required"/>
                <xs:attribute name="status" type="xs:string" use="optional"/>
                <xs:attribute name="model" type="xs:string" use="optional"/>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="id" type="xs:string" use="required"/>
    </xs:complexType>
  </xs:element>

</xs:schema>