1
votes
<?xml version="1.0" encoding="utf-8"  ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="City">
        <xsd:complextype>
            <xsd:sequence>
                <!--BUILDING ELEMENT //1 - Skyscraper-->
                <xsd:element name="Skyscraper">
                    <!--A city can have a total of 50 skyscrapers-->
                    <xsd:complextype>
                        <xsd:sequence>
                            <!--SKYSCRAPER ATTRIBUTE //1 - Material-->
                            <xsd:attribute name="PrimaryMaterial" use="required">
                                <xsd:simpletype>
                                    <xsd:restriction base="xsd:string">
                                        <xsd:enumeration value="concrete"/>
                                        <xsd:enumeration value="steel"/>
                                        <xsd:enumeration value="aluminium"/>
                                        <xsd:enumeration value="glass"/>
                                        <xsd:enumeration value="wood"/>
                                    </xsd:restriction>
                                </xsd:simpletype>
                            </xsd:attribute>
                            <!--SKYSCRAPER ELEMENT //1 - Height-->
                            <xsd:element name="Height" type="xsd:integer"/>

                            <!--SKYSCRAPER ELEMENT //2 - ConstructionStarted-->
                            <xsd:element name="ConstructionStarted" type="xsd:integer"/>

                            <!--SKYSCRAPER ELEMENT //3 ConstructionStopped-->
                            <xsd:element name="ConstructionStopped" type="xsd:integer"/>

                        </xsd:sequence>
                    </xsd:complextype>
                </xsd:element>
            </xsd:sequence>
        </xsd:complextype>
    </xsd:element>

</xsd:schema>

ERROR s4s-elt-must-match.1: The content of 'City' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: complextype.

1

1 Answers

2
votes

XML and XSD are case-sensitive, so you'll have to make (at least) the following corrections to your XSD:

  • xsd:complextypexsd:complexType
  • xsd:simpletypexsd:simpleType