<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <!-- This file describes the  serialization for extensions of the XES format for event log data. -->
  <!-- For more information about XES, visit http://code.fluxicon.com/xes/ -->
  
  <!-- (c) 2009 by Christian W. Guenther (christian@fluxicon.com) -->
  
  <!-- Any extension definition has an xesextension root element. -->
  <!-- Child elements are containers, which define attributes for -->
  <!-- the log, trace, event, and meta level of the XES -->
  <!-- type hierarchy. -->
  <!-- All of these containers are optional. -->
  <!-- The root element further has attributes, defining: -->
  <!--  * The name of the extension. -->
  <!--  * A unique prefix string for  attributes defined by this -->
  <!--    extension. -->
  <!--  * A unique URI of this extension, holding the XESEXT -->
  <!--    definition file. -->
  <xs:element name="xesextension">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" ref="log"/>
        <xs:element minOccurs="0" maxOccurs="1" ref="trace"/>
        <xs:element minOccurs="0" maxOccurs="1" ref="event"/>
        <xs:element minOccurs="0" maxOccurs="1" ref="meta"/>
      </xs:sequence>
      <xs:attribute name="name" use="required" type="xs:NCName"/>
      <xs:attribute name="prefix" use="required" type="xs:NCName"/>
      <xs:attribute name="uri" use="required" type="xs:anyURI"/>
    </xs:complexType>
  </xs:element>
  
  <!-- Container tag for the definition of log attributes. -->
  <xs:element name="log">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="string" type="AttributeType"/>
        <xs:element name="date" type="AttributeType"/>
        <xs:element name="int" type="AttributeType"/>
        <xs:element name="float" type="AttributeType"/>
        <xs:element name="boolean" type="AttributeType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  
  <!-- Container tag for the definition of trace attributes. -->
  <xs:element name="trace">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="string" type="AttributeType"/>
        <xs:element name="date" type="AttributeType"/>
        <xs:element name="int" type="AttributeType"/>
        <xs:element name="float" type="AttributeType"/>
        <xs:element name="boolean" type="AttributeType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  
  <!-- Container tag for the definition of event attributes. -->
  <xs:element name="event">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="string" type="AttributeType"/>
        <xs:element name="date" type="AttributeType"/>
        <xs:element name="int" type="AttributeType"/>
        <xs:element name="float" type="AttributeType"/>
        <xs:element name="boolean" type="AttributeType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  
  <!-- Container tag for the definition of meta attributes. -->
  <xs:element name="meta">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="string" type="AttributeType"/>
        <xs:element name="date" type="AttributeType"/>
        <xs:element name="int" type="AttributeType"/>
        <xs:element name="float" type="AttributeType"/>
        <xs:element name="boolean" type="AttributeType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  
  <!-- Attribute -->
  <xs:complexType name="AttributeType">
    <xs:sequence>
      <xs:element name="alias" type="AliasType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="key" use="required" type="xs:Name"/>
  </xs:complexType>
  
  <!--  Alias definition, defining a mapping alias for an attribute -->
  <xs:complexType name="AliasType">
  	<xs:attribute name="mapping" use="required" type="xs:NCName"/>
  	<xs:attribute name="name" use="required" type="xs:string"/>
  </xs:complexType>

</xs:schema>