<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:pc="http://www.w3.org/2007/01/pls-conformance"
    xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon"
    targetNamespace="http://www.w3.org/2007/01/pls-conformance"
    elementFormDefault="qualified"
	  version="1.0">
  <xs:import namespace="http://www.w3.org/2005/01/pronunciation-lexicon" 
    schemaLocation="http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd"/>
  <xs:attribute name="category">
    <xs:simpleType>
      <xs:restriction base="xs:token">
        <xs:enumeration value="tts"/>
        <xs:enumeration value="asr"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>
  <xs:element name="instructions" type="xs:string">
    <xs:annotation>
      <xs:documentation>
        Instruction for a test that may be customised
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="input">
    <xs:annotation>
      <xs:documentation>Input grapheme</xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attribute name="role" type="pls:role.datatype" use="optional"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="output">
    <xs:annotation>
      <xs:documentation>Output required from PLS processor</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element name="item">
          <xs:complexType>
            <xs:choice maxOccurs="unbounded">
              <xs:element name="outphoneme">
                <xs:annotation>
                  <xs:documentation>pronunciation</xs:documentation>
                </xs:annotation>
                <xs:complexType mixed="true">
                  <xs:attribute name="alphabet" type="pls:alphabet.datatype" 
                    use="required"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="outalias" type="xs:string">
                <xs:annotation>
                  <xs:documentation>text</xs:documentation>
                </xs:annotation>
              </xs:element>
            </xs:choice>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute ref="pc:category" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="test">
    <xs:annotation>
      <xs:documentation>PLS conformance test</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="pc:instructions" minOccurs="0"/>
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="pc:input"/>
          <xs:element ref="pc:output" maxOccurs="2"/>
        </xs:sequence>
        <xs:element name="lexicon">
          <xs:annotation>
            <xs:documentation>PLS lexicon resource</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:attribute name="uri" type="xs:anyURI" use="required"/>
            <xs:attribute name="conformant" type="xs:boolean" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>