Estoy intentando validar mi documento XML con mi esquema XML.Validación de esquema XML: cvc-complex-type.2.4.a
Esta es mi esquema:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://cars.example.org/">
<element name="cars">
<complexType>
<sequence minOccurs="0" maxOccurs="unbounded">
<element name="brand" type="string"/>
</sequence>
</complexType>
</element>
</schema>
y este es mi documento XML:
<?xml version="1.0" encoding="UTF-8"?>
<cars xmlns="http://cars.example.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://cars.example.org/ cars.xsd">
<brand>x</brand>
</cars>
Ahora cuando estoy validar el documento (a través de Eclipse) consigo siguiente mensaje en la línea 4:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'brand'. One of '{"":brand}' is expected.
Este mensaje no tiene ningún sentido :(. Y es muy difícil (imposible?) a la solución de google.
Gracias por su ayuda.