<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns="http://neca.sysis.at/2002/04/necarrl"
	    targetNamespace="http://neca.sysis.at/2002/04/necarrl"
	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	    xmlns:ssml="http://www.w3.org/2001/10/synthesis"
	    xmlns:mary="http://mary.dfki.de/2002/MaryXML"
	    elementFormDefault="qualified"
	    >

    <xsd:annotation>
    <xsd:documentation>
      This is the schema for the  application-independent part of the necaRRL
      Copyright (C) 2002, 2003 The NECA Consortium. All rights reserved.	
    </xsd:documentation>
  </xsd:annotation>
    <xsd:annotation>
        <xsd:documentation>
      This Schema uses parts of the XML Schema
            draft, SSML 1.0 Core Schema (20021129), for which the
            copyright notice is reproduced here:
            Copyright 1998-2002 W3C (MIT,
        INRIA, Keio), All Rights Reserved. Permission to use,
        copy, modify and distribute the SSML core schema and its
        accompanying documentation for any purpose and without
        fee is hereby granted in perpetuity, provided that the
        above copyright notice and this paragraph appear in all
        copies.  The copyright holders make no representation
        about the suitability of the schema for any purpose. 
        It is provided "as is" without expressed or implied
        warranty.</xsd:documentation>
    </xsd:annotation>


  <xsd:annotation>
    <xsd:documentation>Importing dependent namespaces</xsd:documentation>
  </xsd:annotation>

  <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
	      schemaLocation="http://www.w3.org/2001/xml.xsd"/>

  <!-- schema of speech synthesis markup language - SSML -->
  <!-- 
  <xsd:import namespace="http://www.w3.org/2001/10/synthesis"
	      schemaLocation="http://www.w3.org/TR/2002/WD-speech-synthesis-20021202/synthesis.xsd"/>
   -->
  <!-- Sept.2003: using a local copy of the SSML schema -->
  <xsd:import namespace="http://www.w3.org/2001/10/synthesis"
	      schemaLocation="file:synthesis.xsd"/>
  <!-- Generic schema locatioon for SSML-schema --> 
  <!--   schemaLocation="http://www.w3.org/TR/speech-synthesis/synthesis.xsd" -->

  <!-- schema of markup language - MaryXML -->
  <!-- ATTENTION: schema should be placed to the neca server ??? -->
  <xsd:import namespace="http://mary.dfki.de/2002/MaryXML"
	      schemaLocation="file:MaryXML.xsd"/> 

  <!-- include schema-parts which define SMIL-2.0 "lookalike" elements such as <par> and <seq> -->
  <!-- ATTENTION: schema should be placed to the neca server ??? -->
  
  <!-- hp 4.2.02 use "redefine" instead of "include" because neca_smil.xsd has NO namespace 
      (when using "include" the embedded schema has to have the same namespace as the embedding one) -->
  <xsd:redefine schemaLocation="file:neca_smil.xsd"/>

  <!-- The <necaRRL> root element. -->
  <xsd:element name="necaRRL">
    <xsd:complexType>
      <xsd:sequence>
	<xsd:element name="processingState"     type="processingStateType"/>  
	<xsd:element name="initialCommonGround" type="drsType" minOccurs="0"/>
	<xsd:element name="participants"        type="participantsType"/>
	<xsd:element name="temporalOrdering"    type="orderingActsType"/>
     
	<xsd:element name="setOfActs" type="setOfActsType"
		     minOccurs="0"/>

      </xsd:sequence>
      <xsd:attribute name="version" use="required" fixed="0.4">
        <xsd:simpleType>
          <xsd:restriction base="xsd:NMTOKEN"/>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute ref="xml:lang"/>


      <!-- attribute "nextProcessingStep" is only kept for compatibility reasons to v0.3 until neca-komponents are adapted to rrl0.4 -->
      <!-- xsd:attribute name="nextProcessingStep" use="optional">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="sceneGenerator"/>
            <xsd:enumeration value="mmGenerator"/>
            <xsd:enumeration value="speechGenerator"/>
            <xsd:enumeration value="gestureGenerator"/>
            <xsd:enumeration value="animationGenerator"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute -->

    </xsd:complexType>
  </xsd:element>


  <!-- The <proecessingState> element -->
  <!--
  <xsd:complexType name="processingType">
    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
      <xsd:element name="state">
	<xsd:complexType>
	  <xsd:attribute name="avail" use="required">
	    <xsd:simpleType>
	      <xsd:restriction base="xsd:string">
		<xsd:enumeration value="sceneInfoAvailable"/>
		<xsd:enumeration value="mmInfoAvailable"/>
		<xsd:enumeration value="speechInfoAvailable"/>
		<xsd:enumeration value="gestureInfoAvailable"/>
		<xsd:enumeration value="animationInfoAvailable"/>
		<xsd:enumeration value="sceneInfoComplete"/>
		<xsd:enumeration value="mmInfoComplete"/>
		<xsd:enumeration value="speechInfoComplete"/>
		<xsd:enumeration value="gestureInfoComplete"/>
		<xsd:enumeration value="animationInfoComplete"/>
	      </xsd:restriction>
	    </xsd:simpleType>
	  </xsd:attribute>
	</xsd:complexType>
      </xsd:element>
    </xsd:sequence>  
  </xsd:complexType>
  -->
  
  <xsd:complexType name="processingStateType">
    <xsd:sequence minOccurs="1" maxOccurs="unbounded">
      <xsd:element name="state">
	<xsd:complexType>
	  <xsd:attribute name="available" type="xsd:string" use="optional"/>
	  <xsd:attribute name="completed" type="xsd:string" use="optional"/>
	</xsd:complexType>
      </xsd:element>
    </xsd:sequence>  
  </xsd:complexType>
				 

  <!-- The <participants> element -->
  <xsd:complexType name="participantsType">
    <xsd:sequence>
      <xsd:element name="domainSpecificAttr"
                   type="domainSpecificParticipantsType" minOccurs="0"/>
      <!-- One or more <person> elements -->
      <xsd:sequence maxOccurs="unbounded">
	<xsd:element name="person" type="personType"/>
      </xsd:sequence>  
    </xsd:sequence>  
  </xsd:complexType>

  <!-- The <person> element. -->
  <xsd:complexType name="personType">
    <!-- A person has an *id* attribute, and a number of
         child elements, which may occur in any order. -->
    <xsd:all>
      <xsd:element name="realname" type="realnameType"/>
      <xsd:element name="gender" type="genderType"/>
      <!-- The visual appearance of the person, by reference
           to a player character -->
      <xsd:element name="appearance">
        <xsd:complexType>
          <xsd:attribute name="character" use="required" type="xsd:string"/>
        </xsd:complexType>
      </xsd:element>
      <!-- The voice to use for this person, and optionally the
           default prosody. They are specified using a subset of
           SSML. -->

      <xsd:element name="voice" type="voiceType"/>
      <xsd:element name="personality" type="personalityType"/>
      <xsd:element name="domainSpecificAttr"
                   type="domainSpecificPersonAttrType"/>
    </xsd:all>
    <xsd:attribute name="id" type="xsd:ID"/>
  </xsd:complexType>

  <!-- The <realname> element. -->
  <xsd:complexType name="realnameType">
    <xsd:attribute name="title" use="optional" type="xsd:string"/>
    <xsd:attribute name="firstname" use="optional" type="xsd:string"/>
    <xsd:attribute name="middlename" use="optional" type="xsd:string"/>
    <xsd:attribute name="lastname" use="optional" type="xsd:string"/>
  </xsd:complexType>

  <!-- The <gender> element. -->
  <xsd:complexType name="genderType">
    <xsd:attribute name="type" use="required">
      <xsd:simpleType>
        <xsd:restriction base="xsd:string">
          <xsd:enumeration value="male"/>
          <xsd:enumeration value="female"/>
          <xsd:enumeration value="neutral"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
  </xsd:complexType>

  <!-- The <voice> element. -->
  <xsd:complexType name="voiceType">
    <xsd:sequence>
      <xsd:element name="prosody" minOccurs="0" maxOccurs="1">
        <xsd:complexType>
          <xsd:attribute name="pitch" use="optional" type="ssml:pitch.datatype"/>
          <xsd:attribute name="range" use="optional" type="ssml:range.datatype"/>
          <xsd:attribute name="rate" use="optional"  type="ssml:rate.datatype"/>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="name" type="xsd:string" use="required"/>
  </xsd:complexType>


  <!-- SSML extracts used by <prosody>. -->
  <!-- hp.22/11/2002: I <import> these types from the ssml-schema instead of copying them -->

  <!-- The <personality> element. -->
  <xsd:complexType name="personalityType">
    <!-- A <personality> element has attributes
         representing personality factors -->
    <xsd:attribute name="extroversion" use="optional"
                   type="minusOneToOneScaleType"/>
    <xsd:attribute name="agreeableness" use="optional"
                   type="minusOneToOneScaleType"/>
    <xsd:attribute name="neuroticism" use="optional"
                   type="minusOneToOneScaleType"/>
    <!-- Until we know better what politeness actually is
         (a personality trait? an emotion? an attitude?
         something else?), we treat it in the simplest way
         possible, namely as a binary personality trait. -->
    <xsd:attribute name="politeness" use="optional">
      <xsd:simpleType>
        <xsd:restriction base="xsd:string">
          <xsd:enumeration value="polite"/>
          <xsd:enumeration value="impolite"/>
       </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
  </xsd:complexType>


  <!-- Possible values of the personality scales -->
  <xsd:simpleType name="zeroToOneScaleType">
    <!-- Decimal numbers between 0.0 and 1.0 (inclusive)
         with maximally 3 digits after the decimal point. -->
    <xsd:restriction base="xsd:decimal">
      <xsd:minInclusive value="0.0"/>
      <xsd:maxInclusive value="1.0"/>
      <xsd:fractionDigits value="3"/>
    </xsd:restriction>
  </xsd:simpleType>
  

  <!-- NEW Version: use "smil-related" types <seq> and <par> for orderingActs  -->
  <xsd:complexType name="orderingActsType">
    <xsd:annotation>
      <xsd:documentation>
	Temporal ordering: a list /seq/ and /par/ elements, imposing an order
	on /act/-elements. This can be underspecified in the mnlg-input, but
	has to be fully specified in the mnlg-output. Pay attention: this type
	is not entirely "clean" : it allows all substitutions for the abstract
	element "allowed-within-container".
      </xsd:documentation>
    </xsd:annotation>
    <!-- maxOccurs="unbounded" means, that e.g. several <seq>-elements
    may appear at top-level: this is not conformant with SMIL, but is
    useful for specifing partially underspecified temproal ordering
    -->
    <xsd:choice maxOccurs="unbounded">
      <xsd:group ref="smil_structure"/>
    </xsd:choice>                  
  </xsd:complexType>
 
  <xsd:annotation>
      <xsd:documentation>
        The ordering of /act/-references under /orderingReferentsType/
        This element serves for possibly underspecified temporal ordering
        in M-NLG input.
         /sequence/ element may contain, in any order
         recursively, /sequence/, /parallel/ and /act/ elements.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:annotation>
      <xsd:documentation>
	an /act/ element has one attribute which is a reference
	to a dialogue act or a non-communicative act.
	The attribute value is syntactically not restrained,
	but should of course reference one of the acts defined in the
	document.
      </xsd:documentation>
    </xsd:annotation>

 
 <!--  <act> - allowed within smil_tags due to  substitutionGroup="awc" -->
 <xsd:element name="act" substitutionGroup="awc">
    <xsd:complexType>
      <xsd:attribute name="id" type="xsd:IDREF" use="required"/>
    </xsd:complexType>
  </xsd:element>

  <xsd:complexType name="setOfActsType">
    <xsd:annotation>
      <xsd:documentation>
	An UNordered enumeration of /dialogueAct/s and/or /nonCommunicativeActs/ 
      </xsd:documentation>
    </xsd:annotation>
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="dialogueAct"           type="dialogueActType"/>
      <xsd:element name="nonCommunicativeAct"   type="nonCommunicativeActType"/>
    </xsd:choice>
  </xsd:complexType>  


  <!-- ************ dialogue acts and non-communicative acts *********** -->
  <!-- The <dialogueAct> element. -->
  <xsd:complexType name="dialogueActType">
    <xsd:sequence>
      <!-- processingState now also available for dialogue act -->
      <xsd:element name="processingState" type="processingStateType"/>  

      <xsd:element name="domainSpecificAttr"
                   type="domainSpecificDialogueActAttrType"/>
      <xsd:element name="speaker">
        <xsd:complexType>
          <xsd:attribute name="id" type="xsd:IDREF"/>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="addressee" maxOccurs="unbounded">
        <xsd:complexType>
          <xsd:attribute name="id" type="xsd:IDREF"/>
        </xsd:complexType>
      </xsd:element>
      <!-- Emotion is a set and optional. -->
      <xsd:element name="emotion" type="emotionType"
                   minOccurs="0" maxOccurs="1"/>
      <!-- There can be more than one addressee. -->
      <!-- Semantic content is optional -->
      <xsd:element name="semanticContent" type="drsType"
                   minOccurs="0" maxOccurs="1"/>

      <!-- Any number of sentences and gestures  -->
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
	<!-- gewagter versuch: hier ssml:sentence erlauben?? -->
	<!--  <xsd:element ref="ssml:sentence"/> -->
	<!-- hp: hat funktioniert, ist aber nicht wirklich geschickt. Stattdessen wird 
	"ssml:allowed-within-sentence" IN <sentence> verwendet -->
          <xsd:element name="sentence" type="sentenceType"/>
	  <xsd:element name="gesture"  type="gestureMnlgType"/>
      </xsd:choice>

      <xsd:element name="animationSpec" type="animationSpecType"
                   minOccurs="0" maxOccurs="1"/>

    </xsd:sequence>
    <xsd:attribute name="id"         type="xsd:ID"    use="required"/>
    <xsd:attribute name="reactionTo" type="xsd:IDREF" use="optional"/>
  </xsd:complexType>

  <!-- The <emotion> element. is optional -->
  <!-- this includes a set of emotionExpressed and emotionFelt -->
  <xsd:complexType name="emotionType">
    <xsd:sequence>
     <xsd:choice minOccurs="1" maxOccurs="unbounded">
       <xsd:element name="emotionExpressed">
          <xsd:complexType>
 	     <xsd:attributeGroup ref="emotionAttributes"/>
          </xsd:complexType>
       </xsd:element>
       <xsd:element name="emotionFelt">
          <xsd:complexType>
 	     <xsd:attributeGroup ref="emotionAttributes"/>
          </xsd:complexType>
       </xsd:element>
      </xsd:choice>
    </xsd:sequence>
  </xsd:complexType>

 <!-- ********** Common attributes for emotion-types. ********** -->
  <xsd:attributeGroup name="emotionAttributes">
    <!-- The person to which this specification belongs --> 
    <!-- hp 3.3.2003: isn't "person" redundant ???? -->
    <xsd:attribute name="person" use="required" type="xsd:IDREF"/>
    <xsd:attribute name="type" use="required">
      <xsd:simpleType>
        <xsd:restriction base="xsd:string">
	 <!-- These are based on OCC -->
	 <!-- In the long run, probably only a subset of these will be used -->
          <xsd:enumeration value="joy"/>
          <xsd:enumeration value="distress"/>
          <xsd:enumeration value="happy-for"/>
          <xsd:enumeration value="gloating"/>
          <xsd:enumeration value="resentment"/>
          <xsd:enumeration value="sorry-for"/>
          <xsd:enumeration value="hope"/>
          <xsd:enumeration value="fear"/>
          <xsd:enumeration value="satisfaction"/>
          <xsd:enumeration value="relief"/>
          <xsd:enumeration value="fears-confirmed"/>
          <xsd:enumeration value="disappointment"/>
          <xsd:enumeration value="pride"/>
          <xsd:enumeration value="admiration"/>
          <xsd:enumeration value="shame"/>
          <xsd:enumeration value="reproach"/>
          <xsd:enumeration value="liking"/>
          <xsd:enumeration value="disliking"/>
          <xsd:enumeration value="gratitude"/>
          <xsd:enumeration value="anger"/>
          <xsd:enumeration value="gratification"/>
          <xsd:enumeration value="remorse"/>
           <!-- These are added by Elliot -->
          <xsd:enumeration value="love"/>
          <xsd:enumeration value="hate"/>
          <!-- add a "undef" for now -->
          <xsd:enumeration value="undef"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
    <xsd:attribute name="intensity"  type="zeroToOneScaleType" use="required"/>
    <!-- activation/evaluation/power is an alternative encoding for the 
         emotion-categories, which is used by the emotiona; speech-synthesis -->
    <xsd:attribute name="activation" type="minusOneToOneScaleType" use="required"/>
    <xsd:attribute name="evaluation" type="minusOneToOneScaleType" use="required"/>
    <xsd:attribute name="power"      type="minusOneToOneScaleType" use="required"/>
    <!-- Possible object to which emotion is referring to -->
    <xsd:attribute name="object"    use="optional" type="xsd:string"/>
  </xsd:attributeGroup>

  <!-- minusOneToOneScaleType: Possible values on emotion dimensions -->
   <xsd:simpleType name="minusOneToOneScaleType">
     <!-- Decimal numbers between -1.0 and 1.0 (inclusive)
          with maximally 3 digits after the decimal point. -->
     <xsd:restriction base="xsd:decimal">
       <xsd:minInclusive value="-1.0"/>
       <xsd:maxInclusive value="1.0"/>
       <xsd:fractionDigits value="3"/>
     </xsd:restriction>
   </xsd:simpleType>


  <!-- The <nonCommunicativeAct> element. -->
  <xsd:complexType name="nonCommunicativeActType">
    <xsd:attribute name="id" type="xsd:string" use="required"/>
    <!-- currently nothing specified here. -->
  </xsd:complexType>


  <!-- *************** discourse representation structures ************* -->
  <!-- The content of <initialCommonGround> and <semanticContent>
       elements. -->
  <xsd:complexType name="drsType">
    <xsd:sequence>
      <!-- Zero to many <referent> elements -->
      <xsd:element name="referent" minOccurs="0" maxOccurs="unbounded">
        <xsd:complexType>
          <xsd:attribute name="id" type="referentType"/>
        </xsd:complexType>
      </xsd:element>
      <!-- followed by one or many conditions out of the following: -->
      <xsd:choice maxOccurs="unbounded">
        <xsd:element name="unaryCond">
          <xsd:complexType>
            <xsd:attribute name="id" type="xsd:string"/>
            <xsd:attribute name="pred" type="unaryPredicateType"/>
            <xsd:attribute name="arg" type="termType"/>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="binaryCond">
          <xsd:complexType>
            <xsd:attribute name="id" type="xsd:string"/>
            <xsd:attribute name="pred" type="binaryPredicateType"/>
            <xsd:attribute name="argOne" type="termType"/>
            <xsd:attribute name="argTwo" type="termType"/>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="ternaryCond">
          <xsd:complexType>
            <xsd:attribute name="id" type="xsd:string"/>
            <xsd:attribute name="pred" type="ternaryPredicateType"/>
            <xsd:attribute name="argOne" type="termType"/>
            <xsd:attribute name="argTwo" type="termType"/>
            <xsd:attribute name="argThree" type="termType"/>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="conditional">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="argOne" type="drsType"/>
              <xsd:element name="argTwo" type="drsType"/>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="negation" type="drsType"/>
        <xsd:element name="dTopic">
          <xsd:complexType>
            <xsd:attribute name="id" type="xsd:string"/>
            <xsd:attribute name="arg" type="termType"/>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="free">
          <xsd:complexType>
            <xsd:attribute name="id" type="xsd:string"/>
            <xsd:attribute name="arg" type="referentType"/>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="bridge" type="drsType"/>
      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string" use="required"/>
  </xsd:complexType>

  <!-- a term -->
  <xsd:simpleType name="termType">
    <xsd:union memberTypes="drtConstantType referentType"/>
  </xsd:simpleType>

  <!-- a referent -->
  <xsd:simpleType name="referentType">
    <!-- restrict referent names to "x", "y" or "z",
         optionally followed by "_" and a number: -->
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="[xyz](_\d+)?"/>
    </xsd:restriction>
  </xsd:simpleType>


  <!-- ********** The <sentence> element. ********** -->
  <xsd:complexType name="sentenceType" mixed="true">
    <xsd:sequence>
      <!-- First, the textual representation of the entire sentence. -->
      <!-- <text>-element removed completely
      <xsd:element name="text" type="xsd:string" minOccurs="0"/> 
       -->			
      <!-- Then, its structure. -->
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:group ref="sentenceInternalStructuralElements"/>
        <xsd:group ref="wordLevelElements"/>
	<!-- allowing all elements also allowed in <ssml:sentence>  -->
	<xsd:group ref="ssml:allowed-within-sentence"/>
	<!-- allowing alll elements also allowed in <mary:sentence>  -->
	<xsd:group ref="mary:allowed-within-sentence"/>
      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute  name="id"   type="xsd:ID" use="required"/>
    <xsd:attribute  name="src"  type="xsd:anyURI"/>
    <!-- Also allow align-info at the sentence level -->
    <xsd:attributeGroup ref="alignAttr"/>		
  </xsd:complexType>

  <!-- ********** Sentence-internal structural elements. ********** -->
  <xsd:group name="sentenceInternalStructuralElements">
    <xsd:choice>
      <xsd:element name="infoStruct" type="infoStructType"/>
      <xsd:element name="synPhrase" type="synPhraseType"/>
      <xsd:element name="infoStatus" type="infoStatusType"/>
    </xsd:choice>
  </xsd:group>

  <!-- The <infoStruct> element. -->
  <xsd:complexType name="infoStructType">
    <xsd:choice maxOccurs="unbounded">
      <xsd:group ref="sentenceInternalStructuralElements"/>
      <xsd:group ref="wordLevelElements"/>
    </xsd:choice>
    <xsd:attribute name="id" type="xsd:ID" use="optional"/>
    <xsd:attribute name="part">
      <xsd:simpleType>
        <xsd:restriction base="xsd:string">
          <!-- as <theme> is always comprising the whole sentence 
	       it can be omitted in the encoding --> 
          <xsd:enumeration value="theme"/>
          <xsd:enumeration value="rheme"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
  </xsd:complexType>

  <!-- The <synPhrase> element. -->
  <xsd:complexType name="synPhraseType">
    <xsd:choice maxOccurs="unbounded">
      <xsd:group ref="sentenceInternalStructuralElements"/>
      <xsd:group ref="wordLevelElements"/>
    </xsd:choice>
    <!-- The syntactic phrase category -->
    <xsd:attribute name="id" type="xsd:ID" use="optional"/>
    <xsd:attribute name="category" type="syntacticCategoryType"
                   use="required"/>
    <xsd:attribute name="function" type="grammaticalFunctionType"
                   use="required"/>
  </xsd:complexType>

  <!-- The <infoStatus> element. -->
  <xsd:complexType name="infoStatusType">
    <xsd:choice maxOccurs="unbounded">
      <xsd:group ref="sentenceInternalStructuralElements"/>
      <xsd:group ref="wordLevelElements"/>
    </xsd:choice>
    <xsd:attribute name="id" type="xsd:ID" use="optional"/>
    <xsd:attribute name="type" use="required">
      <xsd:simpleType>
        <xsd:restriction base="xsd:string">
          <!-- The possible values for the type attribute: -->
          <xsd:enumeration value="referent-given"/>
          <xsd:enumeration value="concept-given"/>
          <xsd:enumeration value="constrast"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
  </xsd:complexType>

  <!-- ********** Word-level elements. ********** -->
  <xsd:group name="wordLevelElements">
    <xsd:choice>
      <xsd:element name="gesture" type="gestureMnlgType"/>
      <xsd:element name="word" type="wordType"/>
      <xsd:element name="punct" type="punctType"/>
      <xsd:element name="prosBoundary" type="prosBoundaryType"/>
    </xsd:choice>
  </xsd:group>

  <!-- <gesture> element: is part of substitutionGroup for SMIL-content -->
  <!-- 
       NOTE: there are TWO different <gesture> elements:
       1) <gesture> of type gestureMnlgType -> to be used within the m-nlg      contains alignto/aligntype attributes
       2)           of type gestureAnimType -> to be used in the animationSpec: contains smil attributes
   -->
  <xsd:element name="gesture"  type="gestureAnimType" substitutionGroup="awc"/>


  <!-- <audio> element: is part of substitutionGroup for SMIL-content -->
  <xsd:element name="audio" substitutionGroup="awc">
    <xsd:complexType>
      <xsd:attribute        name="src" type="xsd:anyURI"/>
      <xsd:attributeGroup   ref="smil_timingAttributes"/>
    </xsd:complexType>
  </xsd:element>

  <!-- The <word> element. -->
  <xsd:complexType name="wordType" mixed="true">
    <xsd:sequence>
      <xsd:element name="syllable" minOccurs="0" maxOccurs="unbounded"
                   type="syllableType"/>
    </xsd:sequence>
    <!-- Word attributes: -->
    <xsd:attribute name="id" type="xsd:ID" use="optional"/>
    <!-- Textual representation -->
    <!-- Not used any more!
    <xsd:attribute name="text" type="xsd:string" use="required"/>
    -->
    <!-- Part-of-speech -->
    <xsd:attribute name="pos" type="posType" use="optional"/>
    <!-- Phonemic transcription -->
    <xsd:attribute name="sampa" type="xsd:string" use="optional"/>
    <!-- Grammatical function -->
    <xsd:attribute name="function" type="grammaticalFunctionType"
                   use="optional"/>
    <!-- ToBI accent -->
    <xsd:attribute name="accent" type="xsd:string" use="optional"/>
  </xsd:complexType>


  <!-- The <punct> (punctuation) element. -->
  <xsd:complexType name="punctType" mixed="true">
    <xsd:attribute name="id" type="xsd:ID" use="optional"/>
    <!-- not used anyore 
    <xsd:attribute name="text" type="xsd:string"/>
    -->
  </xsd:complexType>

 <!-- attributeGroup for <gesture> -->
 <xsd:attributeGroup name="gestureAttr">
    <xsd:attribute name="modality" use="optional">
      <xsd:simpleType>
        <xsd:restriction base="xsd:string">
          <xsd:enumeration value="voice"/>
          <xsd:enumeration value="face"/>
          <xsd:enumeration value="body"/>
          <xsd:enumeration value="viseme"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
    <!-- "meaning" is intended to be used by GA: when (e.g. timing-) restrictions imply that a gesture 
     is not suitable, GA may select another one with identical meaning -->
    <xsd:attribute name="meaning"    type="xsd:string" use="optional"/>
    <xsd:attribute name="identifier" type="xsd:string" use="required"/>
    <xsd:attribute name="intensity"  type="zeroToOneScaleType" use="optional"/>
 </xsd:attributeGroup>

 <xsd:attributeGroup name="alignAttr">
     <!-- align-atrributes: make them "required" later? -->
     <!-- todo: allow for alignto="none" !!!  --> 
	
    <xsd:attribute name="alignto"     type="xsd:IDREF"    use="optional"/>

    <!-- alternatively alignstart and alignend can be used in order to align to a RANGE of tags -->
    <xsd:attribute name="alignstart"  type="xsd:IDREF"       use="optional"/>
    <xsd:attribute name="alignend"    type="xsd:IDREF"       use="optional"/>
    <!-- aligntype specifies the temporal relation between gesture and the "alignto"-element -->
    <xsd:attribute name="aligntype"   type="alignType"       use="optional"/>
    <!-- begin,  end,  dur -->
    <xsd:attribute name="dur" type="xsd:nonNegativeInteger"  use="optional"/>

 </xsd:attributeGroup>
  
<!-- The <gesture> element.produced by M-NLG etc. -->
  <xsd:complexType name="gestureMnlgType">
    <xsd:attribute name="id" type="xsd:ID" use="required"/>
    <xsd:attributeGroup ref="gestureAttr"/>
    <xsd:attributeGroup ref="alignAttr"/>
  </xsd:complexType>

<!-- The <gesture> element used in under <animationSpec>: 
     alignAttr is missing here
     "id" is IDREF instead of ID : it is only included for debugging purposes  -->
  <xsd:complexType name="gestureAnimType">
    <xsd:attribute name="id" type="xsd:IDREF" use="optional"/>
    <xsd:attributeGroup ref="gestureAttr"/>
    <xsd:attributeGroup ref="smil_timingAttributes"/>
  </xsd:complexType>

  <!-- animation type: holds all the information for the animation-timing 
       within a dialogueAct: it now allows smil-lookalikes <par> and <seq> with embedded <gestures> -->
  <xsd:complexType name="animationSpecType">
    <xsd:choice>
      <xsd:group ref="smil_structure"/>
    </xsd:choice>
  </xsd:complexType>

  <!-- the aligntype-attribute --> 
  <!-- what's about sequences of <gestures> like in the current eshowroom? Then alignwith must be another gesture -->
  <xsd:simpleType name="alignType">
    <xsd:restriction base="xsd:string">
      <xsd:annotation>
	<xsd:documentation>
	  How are gesture G and "alignto" element X coupled to each other?
          PARALELLISM
	  par :          G and X start at the same time
	  par_start:     G and X start at the same time (identical to "par"!)
	  par_end   :    G and X stops at the same time
	  
          par_adjust_to_fit	(formerly: par_stretch)
	:   G's duration is forced to be the same as X's : they start and stop at the same time

	  atstress:  G is aligned to the STRESSED position of X

	  SEQUENTIALITY
	  
	  seq_before :    G is performed before X --> preceede
	  seq_after  :    G is performed after  X --> succeede
	</xsd:documentation>
      </xsd:annotation>

      <!-- parallelism -->
      <!-- par_start -->
      <xsd:enumeration value="par"/>
      <xsd:enumeration value="par_start"/> <!-- is the same as "par" -->
      <xsd:enumeration value="par_end"/>
      <xsd:enumeration value="par_stretch"/>
      <!-- a better name for par_stretch ??? -->
      <xsd:enumeration value="par_adjust_to_fit"/> 
      <!-- sequentiality -->
      <xsd:enumeration value="seq_before"/>
      <xsd:enumeration value="seq_after"/>
      <!-- or do you prefer the following tags instead ?? -->
      <xsd:enumeration value="preceede"/>
      <xsd:enumeration value="succeede"/>

      <xsd:enumeration value="atstress"/>
      <!-- "none" can be used when a <gesture> is alone in a speech-act (or is the first one in a sequence of <gesture>s 
	BUT cutrrently alignto="none" is the relevant encoding -->
      <xsd:enumeration value="none"/>
    </xsd:restriction>
  </xsd:simpleType>
  
  <!-- The <prosBoundary> element. -->
  <xsd:complexType name="prosBoundaryType">
    <xsd:sequence>
      <!-- prosBoundary may contain PHONEMES - typically "_" but also breathing might be specified -->
      <xsd:element ref="ph" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:ID" use="optional"/>
    <xsd:attribute name="tone" type="xsd:string" use="required"/>
    <xsd:attribute name="breakindex" type="xsd:positiveInteger"
                    use="required"/>
    <xsd:attribute name="dur" type="xsd:nonNegativeInteger" default="0" use="optional"/>
  </xsd:complexType>

<!-- phoneme-element -->
 <xsd:element name="ph" type="phType"/>

  <!-- ********** Elements below word level ********** -->
  <!-- The <syllable> element. -->
  <xsd:complexType name="syllableType">
    <xsd:sequence>
      <!-- The phonemes composing the syllable -->
      <xsd:element ref="ph" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:ID" use="optional"/>
    <xsd:attribute name="stress" default="0">
      <xsd:simpleType>
        <xsd:restriction base="xsd:nonNegativeInteger">
          <xsd:maxInclusive value="2"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
    <xsd:attribute name="accent" type="xsd:string" use="optional"/>
  </xsd:complexType>

  <!-- The <ph> (phoneme) element. -->
  <xsd:complexType name="phType">
    <!-- The phoneme symbol -->
    <xsd:attribute name="p" type="xsd:string" use="required"/>
    <!-- The phoneme duration, in milliseconds -->
    <xsd:attribute name="dur" type="xsd:positiveInteger" use="required"/>
    <xsd:attribute name="id" type="xsd:ID" use="optional"/>
  </xsd:complexType>

  <!-- ********** Possible values for syntactic tags ********** -->
  <!-- Part of speech tags -->
  <xsd:simpleType name="posType">
    <xsd:restriction base="xsd:string">
      <!-- add the list of possible values here -->
    </xsd:restriction>
  </xsd:simpleType>

  <!-- Syntactic phrase categories -->
  <xsd:simpleType name="syntacticCategoryType">
    <xsd:restriction base="xsd:string">
      <!-- add the list of possible values here -->
    </xsd:restriction>
  </xsd:simpleType>

  <!-- Grammatical functions -->
  <xsd:simpleType name="grammaticalFunctionType">
    <xsd:restriction base="xsd:string">
      <!-- add the list of possible values here -->
    </xsd:restriction>
  </xsd:simpleType>

</xsd:schema>



