﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Chat"
		   targetNamespace="http://waher.se/Schema/Chat.xsd"
		   elementFormDefault="qualified"
		   xmlns="http://waher.se/Schema/Chat.xsd"
		   xmlns:mstns="http://waher.se/Schema/Chat.xsd"
		   xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<xs:element name="Chat">
		<xs:complexType>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element name="Received" type="TextItem"/>
        <xs:element name="Transmitted" type="TextItem"/>
        <xs:element name="Event" type="TextItem"/>
      </xs:choice>
      <xs:attribute name="muc" type="xs:boolean" use="optional" default="false"/>
		</xs:complexType>
	</xs:element>

	<xs:complexType name="TextItem">
		<xs:simpleContent>
			<xs:extension base="xs:string">
        <xs:attribute name="timestamp" type="xs:dateTime" use="required"/>
        <xs:attribute name="from" type="xs:string" use="optional"/>
        <xs:attribute name="thread" type="xs:string" use="optional"/>
      </xs:extension>
		</xs:simpleContent>
	</xs:complexType>

</xs:schema>
