<?xml version="1.0" encoding="UTF-8"?>
<!--
	The XML Corpus Encoding Standard
	XCES Revision 0.4
		
	Encoding conventions for parallel text alignment.
				
-->
<!--W3C Schema generated by XML Spy v4.2 U (http://www.xmlspy.com)-->
<xs:schema targetNamespace="http://www.xces.org/schema/2003"
        xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xces="http://www.xces.org/schema/2003"
        xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
        <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xcesLink.xsd"/>
        <xs:include schemaLocation="xcesHeader.xsd"/>
        <xs:attributeGroup name="a.align">
                <xs:annotation>
                        <xs:documentation xml:lang="en">The attributes a.align include the attributes wsd and
                                xml:base, wsd is used to indicate that the tag's content is encoded
                                in the specified character set. The value of the attribute is the
                                character set name (ISO-8859-1, etc.) which should be the same as
                                that appearing on a &lt;writingSystem&gt; element in the
                                header document which describes that character set. </xs:documentation>
                </xs:annotation>
                <xs:attribute name="wsd" type="xs:string"/>
                <xs:attribute ref="xml:base"/>
        </xs:attributeGroup>
        <xs:complexType name="class.align" mixed="false">
                <xs:complexContent mixed="false">
                        <xs:extension base="xces:class.global">
                                <xs:attributeGroup ref="xces:a.align"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:element name="cesAlign">
                <xs:annotation>
                        <xs:documentation xml:lang="en">A single annotation document, containing a
                                &lt;cesHeader&gt; element, followed by a
                                &lt;linkList&gt; element. </xs:documentation>
                </xs:annotation>
                <xs:complexType>
                        <xs:complexContent>
                                <xs:extension base="xces:class.align">
                                        <xs:sequence>
                                                <xs:group ref="xces:headerGroup" minOccurs="0"/>
<!--                                                 <xs:element name="linkList" type="xces:linkListType" minOccurs="0"/> -->
                                        </xs:sequence>
<!--                                         <xs:attribute name="type"> -->
<!--                                                 <xs:simpleType> -->
<!--                                                   <xs:restriction base="xs:NMTOKEN"> -->
<!--                                                   <xs:enumeration value="par"/> -->
<!--                                                   <xs:enumeration value="sent"/> -->
<!--                                                   <xs:enumeration value="tok"/> -->
<!--                                                   </xs:restriction> -->
<!--                                                 </xs:simpleType> -->
<!--                                         </xs:attribute> -->
                                        <xs:attribute name="version" type="xs:string" use="required"/>
<!--                                         <xs:attribute name="fromDoc" type="xs:anyURI"/> -->
<!--                                         <xs:attribute name="toDoc" type="xs:anyURI"/> -->
                                </xs:extension>
                        </xs:complexContent>
                </xs:complexType>
                <!-- This is no longer possible since the header is no longer stored with the alignment data
		<xs:key name="TranslationKey">
			<xs:selector xpath=".//xces:translation"/>
			<xs:field xpath="@n"/>
		</xs:key>
		<xs:keyref name="TranslationKeyLookup" refer="xces:TranslationKey">
			<xs:selector xpath=".//xces:align"/>
			<xs:field xpath="@n"/>
		</xs:keyref>
		-->
        </xs:element>
        <xs:complexType name="xlinkType">
                <xs:annotation>
                        <xs:documentation xml:lang="en">An XLink extended link specifying the XML elements in
                                documents that have been aligned. </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="xces:class.align">
                                <xs:sequence>
                                        <xs:element name="align" type="xces:alignType" maxOccurs="unbounded"/>
                                </xs:sequence>
                                <xs:attribute name="evaluate">
                                        <xs:simpleType>
                                                <xs:restriction base="xs:NMTOKEN">
                                                  <xs:enumeration value="all"/>
                                                  <xs:enumeration value="one"/>
                                                  <xs:enumeration value="none"/>
                                                </xs:restriction>
                                        </xs:simpleType>
                                </xs:attribute>
                                <xs:attribute ref="xlink:type" fixed="extended"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="linkGrpType">
                <xs:annotation>
                        <xs:documentation xml:lang="en">Contains a series of links considered to be a group. In
                                most cases, a group of links apply to data within a particular text
                                division, paragraph, etc. This can be indicated using the domains
                                attribute. </xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="xces:class.align">
                                <xs:sequence>
                                        <xs:element name="link" type="xces:xlinkType" maxOccurs="unbounded">
                                                <xs:unique name="UniqueTargets">
                                                  <xs:selector xpath="xces:align"/>
                                                  <xs:field xpath="@n"/>
                                                </xs:unique>
                                                <!--  Each align element must have a unique n element.  That is, each must refer to a different translation -->
                                        </xs:element>
                                </xs:sequence>
                                <xs:attribute name="type" type="xs:string"/>
                                <xs:attribute name="fromDoc" type="xs:anyURI"/>
                                <xs:attribute name="toDoc" type="xs:anyURI"/>
                                <xs:attribute name="fromLoc" type="xs:anyURI"/>
                                <xs:attribute name="toLoc" type="xs:anyURI"/>
                                <xs:attribute name="targType" type="xs:NMTOKENS"/>
                                <xs:attribute name="domains" type="xs:string"/>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="linkListType" mixed="false">
                <xs:annotation>
                        <xs:documentation xml:lang="en">Contains one or more occurrences of the element &lt;linkGrp&gt;</xs:documentation>
                </xs:annotation>
                <xs:complexContent mixed="false">
                        <xs:extension base="xces:class.align">
                                <xs:sequence>
                                        <xs:element name="linkGrp" type="xces:linkGrpType" maxOccurs="unbounded"/>
                                </xs:sequence>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
        <xs:complexType name="alignType">
                <xs:annotation>
                        <xs:documentation xml:lang="en">An XLink locator that identifies the tokens, words,
                                sentences, that have been aligned.</xs:documentation>
                </xs:annotation>
                <xs:complexContent>
                        <xs:extension base="xces:class.align">
                                <xs:attribute ref="xlink:type" fixed="simple"/>
                                <xs:attribute ref="xlink:href" use="required"/>
                                <xs:attribute name="evaluate">
                                        <xs:simpleType>
                                                <xs:restriction base="xs:NMTOKEN">
                                                  <xs:enumeration value="ALL"/>
                                                  <xs:enumeration value="ONE"/>
                                                  <xs:enumeration value="NONE"/>
                                                </xs:restriction>
                                        </xs:simpleType>
                                </xs:attribute>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>
</xs:schema>

