-2

XML validation through xsd gives me this error, but i am not able to find where is my mistake with tags. I´d been trhough xsd and all tags look good for me. All entities seem to be closed, so I dont understand why end-tag of sequence is giving error.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="pokemon">
        <xs:complexType>
        <xs:attribute name="id" type="xs:integer"/>
            <xs:sequence>
                <xs:element name="nombre">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:maxLength value="10"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element name="codigo">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:pattern value="[PK\-] [000-151]"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element name="foto" type="anyURI"/>
                <xs:element name="color" type="xs:string"/>
                <xs:element name="tipo">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:enumeration value="Planta/Veneno"/>
                            <xs:enumeration value="Fuego"/>
                            <xs:enumeration value="Fuego/Volador"/>
                            <xs:enumeration vaule="Agua"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element name="fuerza">
                    <xs:simpleType>
                        <xs:restriction base="xs:integer">
                            <xs:pattern value="[0-1000]{4}"/>
                        </xs:restriction>
                    </xs:simpleType>
                <xs:element name="comentario">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:maxLength value="50"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

1 Answers1

1

As it happens, the syntax highlighting on StackOverflow shows immediately where the error is.

Well, it did. I've refreshed the page and that's no longer the case...

Most decent XML editors will also make these problems easy to spot, at least for shortish files. Always use a good XML editor, to save your time and ours.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164