<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:element name="fortunekookie_message">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="message" type="messageType" minOccurs="1" maxOccurs="10"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	
	<xsd:complexType name="messageType">
		<xsd:sequence>
			<xsd:element name="front" type="xsd:string"/>
			<xsd:element name="back" type="xsd:string"/>
			<xsd:element name="lucky_nbr" type="luckyType"/>
		</xsd:sequence>
		<xsd:attribute name="timestamp" type="xsd:dateTime"/>
		<xsd:attribute name="fk_id" type="idType"/>
		<xsd:attribute name="status" type="statusType"/>
	</xsd:complexType>

	<xsd:complexType name="luckyType">
		<xsd:attribute name="nbr1" type="nbrType"/>
		<xsd:attribute name="nbr2" type="nbrType"/>
		<xsd:attribute name="nbr3" type="nbrType"/>
		<xsd:attribute name="nbr4" type="nbrType"/>
		<xsd:attribute name="nbr5" type="nbrType"/>
		<xsd:attribute name="nbr6" type="power_ballType"/>
	</xsd:complexType>

	<xsd:simpleType name="idType">
		<xsd:restriction base="xsd:string">
    	<xsd:length value="10"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="statusType">
		<xsd:restriction base="xsd:integer">
    	<xsd:minInclusive value="0"/> <!-- No Error -->
    	<xsd:maxInclusive value="1"/> <!-- Error    -->
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="nbrType">
		<xsd:restriction base="xsd:integer">
    	<xsd:minInclusive value="1"/>
    	<xsd:maxInclusive value="56"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="power_ballType">
		<xsd:restriction base="xsd:integer">
    	<xsd:minInclusive value="1"/>
    	<xsd:maxInclusive value="46"/>
		</xsd:restriction>
	</xsd:simpleType>

</xsd:schema>
