Error:
s4s-elt-must-match.1: The content of 'viviendas' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: complextype.
Schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://wwww.vivienda.io"
xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.vivienda.io">
<xs:element name="viviendas">
<xs:complextype>
<xs:sequence maxoccurs="unbounded">
<xs:element name="vivienda" minoccurs="1">
<xs:complextype>
<xs:sequence>
<xs:element name="direccion">
<xs:complextype>
<xs:sequence>
<xs:element name="calle"></xs:element>
<xs:element name="numero"></xs:element>
<xs:element name="localidad"></xs:element>
<xs:element name="provincia"></xs:element>
</xs:sequence>
</xs:complextype>
</xs:element>
<xs:element name="refCatastral"></xs:element>
<xs:element name="habitaciones">
<xs:complextype>
<xs:sequence>
<xs:element name="habitacion" minoccurs="1">
<xs:complextype>
<xs:attribute name="area" use="required" type="xs:string">
<xs:complextype>
<xs:restriction base="xs:integer">
<xs:mininclusive value="1"/>
<xs:maxlength value="2"/>
</xs:restriction>
</xs:complextype>
</xs:attribute>
<xs:attribute name="tipo" use="required" >
<xs:complextype>
<xs:restriction base="xs:string">
<xs:pattern value="salon|cocina|baño|dormitorio"/>
</xs:restriction>
</xs:complextype>
</xs:attribute>
</xs:complextype>
</xs:element>
</xs:sequence>
</xs:complextype>
</xs:element>
<xs:element name="servicios">
<xs:complextype>
<xs:sequence>
<xs:element name="servicio" minoccurs="1"></xs:element>
</xs:sequence>
</xs:complextype>
</xs:element>
</xs:sequence>
</xs:complextype>
</xs:element>
<xs:element name="comprador" minoccurs="0" maxoccurs="1">
<xs:complextype>
<xs:attribute name="dni" use="required">
<xs:simpletype>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{9}[A-Z]{1}"/>
</xs:restriction>
</xs:simpletype>
</xs:attribute>
<xs:sequence>
<xs:element name="nombre"></xs:element>
<xs:element name="edad" >
<xs:simpletype>
<xs:restriction base="xs:integer">
<xs:mininclusive value="1"/>
</xs:restriction>
</xs:simpletype>
</xs:element>
<xs:element name="ref_catastral"></xs:element>
</xs:sequence>
</xs:complextype>
</xs:element>
</xs:sequence>
</xs:complextype>
</xs:element>
</xs:schema>
XML tags are CaSe SenSitIve.
complexType
!=complextype
. You need to fix that throughout your schema - it's expecting to find<xs:complexType>
but instead finding<xs:complextype>
, which is not valid.It looks like you will have similar problems elsewhere - for example,
simpleType
,maxLength
are other tags that have different casing than the lower case names you've used in your schema. As you fix each error, your validation software should indicate the next error.