I am trying to validate an XML schema but I keep getting a few errors that I do not know what they mean. I've been trying to solve the problems for a while now, but cannot get past these errors.
Line 12:
inventory.xsd:12:cvc-complex-type.2.4.a: Invalid content was found starting with element 'xsd:element'. One of '{"http://ift.tt/tphNwY":attribute, "http://ift.tt/tphNwY":attributeGroup, "http://ift.tt/tphNwY":anyAttribute}' is expected.
Line 14:
inventory.xsd:14:cvc-complex-type.2.4.a: Invalid content was found starting with element 'xsd:element'. One of '{"http://ift.tt/tphNwY":annotation, "http://ift.tt/tphNwY":restriction, "http://ift.tt/tphNwY":list, "http://ift.tt/tphNwY":union}' is expected.
Line 18:
inventory.xsd:18:cvc-complex-type.2.4.a: Invalid content was found starting with element 'xsd:attribute'. One of '{"http://ift.tt/tphNwY":annotation, "http://ift.tt/tphNwY":simpleType, "http://ift.tt/tphNwY":complexType, "http://ift.tt/tphNwY":unique, "http://ift.tt/tphNwY":key, "http://ift.tt/tphNwY":keyref}' is expected.
Here is the XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://ift.tt/tphNwY">
<xsd:element name="inventories">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="INVENTORY">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="BOOK">
<xsd:complexType>
<xsd:attribute name="Instock" type="boolean" use="required"/>
<xsd:element name="TITLE" type="anyType">
<xsd:simpleType>
<xsd:element name="SUBTITLE" type="anyType"/>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AUTHOR" type="string">
<xsd:attribute name="Born" type="gYear"/>
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="FIRST_NAME" type="anyType"/>
<xsd:element minOccurs="1" maxOccurs="1" name="LAST_NAME" type="anyType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="BINDING" type="string">
<xsd:simpleType>
<xsd:restriction base="string">
<xsd:enumeration value="hardcover"/>
<xsd:enumeration value="mass market paperback"/>
<xsd:enumeration value="trade paperback"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PAGES" type="positiveInteger">
<xsd:complexType>
<xsd:attribute name="FrontMatter" type="positiveInteger" use="optional"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="PRICE" type="decimal">
<xsd:simpleType>
<xsd:restriction base="xsd:decimal">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PUBLISH_DATE" type="gYearMonth"/>
<xsd:element name="ISBN" type="integer"/>
<xsd:element name="SUMMARY" type="anyType"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Thank you in advance.
No comments:
Post a Comment