XML-schema-Gültigkeit: cvc-complex-type.2.4.ein

Ich versuche zur Validierung meines XML-Dokuments gegen meine XML-schema.

Dies ist mein schema:

<?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>

und das ist mein XML-Dokument:

<?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>

Wenn ich jetzt das Dokument überprüft (über Eclipse) bekomme ich folgende Meldung auf Zeile 4:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'brand'. One of '{"":brand}' is expected.

Diese Meldung macht keinen Sinn :(. Und es ist sehr schwer (unmöglich?) google-Lösung.

Danke für Eure Hilfe.

InformationsquelleAutor woky | 2011-09-20
Schreibe einen Kommentar