<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">

<xsd:complexType name="ref" content="empty">
	<xsd:attribute name="href" type="xsd:IDREF"/>
</xsd:complexType>

<xsd:complexType name="authorType" content="elementOnly">
	<xsd:sequence>
		<xsd:element name="name" type="xsd:string"/>
		<xsd:element name="nickName" type="xsd:string"/>
		<xsd:element name="born" type="xsd:string"/>
		<xsd:element name="dead" type="xsd:string"/>
	</xsd:sequence>
  <xsd:attribute name="id" type="xsd:ID"/>

</xsd:complexType>

<xsd:complexType name="bookType" content="elementOnly">
	<xsd:sequence>
		<xsd:element name="isbn" type="xsd:int"/>
		<xsd:element name="title" type="xsd:string"/>
		<xsd:element name="author" type="ref" minOccurs="1" maxOccurs="unbounded"/>
		<xsd:element name="character" type="ref" minOccurs="0" maxOccurs="unbounded"/>
	</xsd:sequence>
  <xsd:attribute name="id" type="xsd:ID"/>
</xsd:complexType>

<xsd:complexType name="characterType" content="elementOnly">
	<xsd:sequence>
		<xsd:element name="name" type="xsd:string"/>
		<xsd:element name="since" type="xsd:string"/>
		<xsd:element name="qualification" type="xsd:string"/>
	</xsd:sequence>
  <xsd:attribute name="id" type="xsd:ID"/>
</xsd:complexType>

<xsd:element name="library">
	<xsd:complexType content="elementOnly">
	<xsd:sequence>
		<xsd:element name="book" type="bookType" minOccurs="0" maxOccurs="unbounded"/>
		<xsd:element name="author" type="authorType" minOccurs="0" maxOccurs="unbounded"/>
		<xsd:element name="character" type="characterType" minOccurs="0" maxOccurs="unbounded"/>
	</xsd:sequence>
 </xsd:complexType>
	
</xsd:element>


</xsd:schema>

