Hi All!I'm relatively new to XML and am busy writing a schema. When I try to validate this, however, I get 6 errors, all the same (but on other lines and with other refs):Error: Invalid content found starting with element 'xs:element'. One of '{"http://www.w3.org/2001/XMLSchema":annotation, "http://www.w3.org/2001/XMLSchema":simpleContent, "http://www.w3.org/2001/XMLSchema":complexContent, "http://www.w3.org/2001/XMLSchema":group, "http://www.w3.org/2001/XMLSchema":all, "http://www.w3.org/2001/XMLSchema":choice, "http://www.w3.org/2001/XMLSchema":sequence, "http://www.w3.org/2001/XMLSchema":attribute, "http://www.w3.org/2001/XMLSchema":attributeGroup, "http://www.w3.org/2001/XMLSchema":anyAttribute}' is expected.Attribute 'ref' is not permitted to appear in element 'xs:element'.Attribute 'minOccurs' is not permitted to appear in element 'xs:element'.Attribute 'maxOccurs' is not permitted to appear in element 'xs:element'.Attribute 'name' must appear on element 'xs:element'. Error Position: <xs:element ref="author" minOccurs="1" maxOccurs="unbounded"/>I don't understand what is wrong with my XML, since an example I found on the web (http://www.xml.com/pub/a/2000/11/29/schemas/part1.html?page=2) DOES work, with practically the same code... Also, I don't understand this errormessage, why are 'ref', 'minOccurs' and 'maxOccurs' not permitted?I've tried looking for this error on the web and I've tried other resources, I just don't seem to be able to figure this out...Thanks a lot for your help!MXML-code:
<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <!-- definition of simple type elements --> <xs:element name="title" type="xs:string"/> <xs:element name="city" type="xs:string"/> <xs:element name="name" type="xs:string"/> <xs:element name="year" type="xs:integer"/> <xs:element name="volume" type="xs:integer"/> <xs:element name="number" type="xs:integer"/> <xs:element name="part" type="xs:integer"/> <!-- definition of attributes --> <xs:attribute name="from" type="xs:integer"/> <xs:attribute name="to" type="xs:integer"/> <xs:attribute name="name" type="xs:string"/> <!-- definition of complex type elements --> <xs:element name="author"> <xs:complexType> <xs:attribute ref="name"/> </xs:complexType> </xs:element> <xs:element name="editor"> <xs:complexType> <xs:attribute ref="name"/> </xs:complexType> </xs:element> <xs:element name="page"> <xs:complexType> <xs:attribute ref="name"/> <xs:attribute ref="to"/> </xs:complexType> </xs:element> <xs:element name="authors"> <xs:complexType> <xs:element ref="author" minOccurs="1" maxOccurs="unbounded"/> </xs:complexType> </xs:element> <xs:element name="editors"> <xs:complexType> <xs:element ref="editor" minOccurs="1" maxOccurs="unbounded"/> </xs:complexType> </xs:element> <xs:element name="publisher"> <xs:complexType> <xs:sequence> <xs:element ref="city" minOccurs="1" maxOccurs="1"/> <xs:element ref="name" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="book"> <xs:complexType> <xs:sequence> <xs:element ref="authors" minOccurs="1" maxOccurs="unbounded"/> <xs:element ref="year" minOccurs="0" maxOccurs="1"/> <xs:element ref="title" minOccurs="1" maxOccurs="1"/> <xs:element ref="publisher" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="journal"> <xs:complexType> <xs:sequence> <xs:element ref="title" minOccurs="1" maxOccurs="1"/> <xs:element ref="volume" minOccurs="1" maxOccurs="1"/> <xs:element ref="number" minOccurs="0" maxOccurs="1"/> <xs:element ref="part" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="journalentry"> <xs:complexType> <xs:sequence> <xs:element ref="authors" minOccurs="1" maxOccurs="unbounded"/> <xs:element ref="year" minOccurs="1" maxOccurs="1"/> <xs:element ref="title" minOccurs="1" maxOccurs="1"/> <xs:element ref="editors" minOccurs="0" maxOccurs="1"/> <xs:element ref="journal" minOccurs="1" maxOccurs="1"/> <xs:element ref="page" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="proceeding"> <xs:complexType> <xs:sequence> <xs:element ref="authors" minOccurs="1" maxOccurs="unbounded"/> <xs:element ref="year" minOccurs="1" maxOccurs="1"/> <xs:element ref="title" minOccurs="1" maxOccurs="1"/> <xs:element ref="editors" minOccurs="0" maxOccurs="1"/> <xs:element ref="journal" minOccurs="1" maxOccurs="1"/> <xs:element ref="page" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="chapter"> <xs:complexType> <xs:sequence> <xs:element ref="authors" minOccurs="1" maxOccurs="unbounded"/> <xs:element ref="year" minOccurs="1" maxOccurs="1"/> <xs:element ref="title" minOccurs="1" maxOccurs="1"/> <xs:element ref="book" minOccurs="1" maxOccurs="1"/> <xs:element ref="page" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="books"> <xs:complexType> <xs:element ref="book" minOccurs="0" maxOccurs="unbounded"/> </xs:complexType> </xs:element> <xs:element name="journals"> <xs:complexType> <xs:element ref="journalentry" minOccurs="0" maxOccurs="unbounded"/> </xs:complexType> </xs:element> <xs:element name="chaptersAndProceedings"> <xs:complexType> <xs:element ref="proceeding" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="chapter" minOccurs="0" maxOccurs="unbounded"/> </xs:complexType> </xs:element> <xs:element name="references"> <xs:complexType> <xs:sequence> <xs:element ref="books"/> <xs:element ref="journals" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="chaptersAndProceedings"/> </xs:sequence> </xs:complexType> </xs:element></xs:schema>