<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 <xsd:complexType name = "authorType">
      <xsd:sequence>
          <xsd:element name = "address" type = "xsd:string" />
          <xsd:element name = "name">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name = "firstname" type = "xsd:string" minOccurs = "0" />
                  <xsd:element name = "lastname" type = "xsd:string" />
                </xsd:sequence>
              </xsd:complexType>
          </xsd:element>
      </xsd:sequence>
      <xsd:attribute name = "authorid" type = "xsd:int" use = "required" />
  </xsd:complexType>
  
  <xsd:complexType name = "monographType">
      <xsd:sequence>
          <xsd:element name = "editor">
              <xsd:complexType>
                  <xsd:sequence>
                      <xsd:element name = "edname" type = "xsd:string" />
                      <xsd:element name = "monograph" type = "monographType" minOccurs = "0" 
maxOccurs = "unbounded" />
                  </xsd:sequence>
              </xsd:complexType>
          </xsd:element>
          <xsd:element name = "author" type = "authorType" />
      </xsd:sequence>
  </xsd:complexType>

  <xsd:element name = "publications">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name = "book">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name = "booktitle" type = "xsd:string" />
                        <xsd:element name = "author" type = "authorType" />
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name = "article">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name = "author" type = "authorType" minOccurs = "0" maxOccurs = "unbounded" />
                        <xsd:element name = "title" type = "xsd:string" />
                        <xsd:element name = "contactauthor" minOccurs = "0">
                            <xsd:complexType>
                                <xsd:attribute name = "authorID" type = "xsd:int" use = "required" />
                            </xsd:complexType>
                        </xsd:element>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name = "monograph" type = "monographType" />
        </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>
