<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    
<xs:element name="notebook">  
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
   <xs:element name="note" type="Note"/>
</xs:sequence>
<xs:attribute ref="date"/>
</xs:complexType>
</xs:element>

<xs:complexType name="Note">
<xs:sequence>
<xs:element name="subject" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>

<xs:attribute ref="date" use="required"/>
<xs:attribute name="category" type="xs:string"/>

</xs:complexType>

<xs:attribute name="date" type="xs:date"/>
</xs:schema>


