debebeekfhkja
New Member
I'm trying to write an XSD document \[code\]<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:books" xmlns:bks="urn:books"> <xsd:element name="Books" type="bks:BooksForm"/> <xsd:complexType name="BooksForm"> <xsd:sequence> <xsd:element name="Book" type="bks:BookForm" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="BookForm"> <xsd:sequence> <xsd:element name="Author" type="bks:AuthorForm" minOccurs="1" /><!--1--> <xsd:element name="Isbn" type="xsd:string" minOccurs="1" /> <xsd:element name="Title" type="xsd:string" minOccurs="1" /> <xsd:element name="Publisher" type="xsd:string" minOccurs="1" /> <xsd:element name="YearValue" type="bks:YearForm" minOccurs="1" /><!--2--> </xsd:sequence> <xsd:attribute name="Cover" type="xsd:string"/> </xsd:complexType> <xsd:complexType name="AuthorForm"> <xsd:sequence> <xsd:element name="Name" type="bks:NameForm"/><!--1--> <xsd:element name="Contact" type="bks:ContactForm"/> <!--2--> </xsd:sequence> </xsd:complexType> <xsd:complexType name="YearForm"> <xsd:sequence> <xsd:element name="Year" type="xsd:integer"/><!--1--> </xsd:sequence> <xsd:attribute name="Edition" type="xsd:integer"/> </xsd:complexType> <xsd:complexType name="NameForm"> <xsd:sequence> <xsd:element name="First" type="xsd:string"/><!--1--> <xsd:element name="Last" type="xsd:string"/> <!--2--> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ContactForm"> <xsd:sequence> <xsd:element name="Phone" type="xsd:string"/><!--1--> </xsd:sequence> <xsd:attribute name="Office" type="xsd:string"/> </xsd:complexType></xsd:schema>\[/code\]that matches with the following XML document\[code\]<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="http://stackoverflow.com/questions/15796444/Courses.xsl"?><Books> <Book Cover="Paper back"> <Isbn>978-1-4652-0558-2</Isbn> <Title>Service-Oriented Computing</Title> <Author> <Name> <First>John</First> <Last>Doe</Last> </Name> <Contact Office="BY400"> <Phone>480-965 000</Phone> </Contact> </Author> <Publisher>Kendall Hunt</Publisher> <Year Edition="3"> <Year>2012</Year> </Year> </Book>....</Books>\[/code\]However I'm getting the following error, when I try to validate it online \[code\]Line 3, 8 cvc-elt.1.a: Cannot find the declaration of element 'Books'.\[/code\]But as far as I can see, Ive declared it correctly. Can anyone point out what Im doing wrong here? Thanks