[jdom-interest] Validate XML by XSD failes with jDOM and Xerces 2.10.0
Ronny at bigfunfitness.de
Sat Apr 6 05:16:20 PDT 2013
I've got a problem validating a xml by a xsd.
A short preview about the xsd:
<attribute name="MyAttribute" type="string" use="required" />
<complexType name="MyType1 ... />
<element name="MyType1" ... />
<element name="MyType2" type="MyType2" minOccurs="1" maxOccurs="1" />
Ok, my XML file looks like this:
<MyRoot xmlns="..." ...>
Now I try to validate this with jDOM by using xerces. Then I got the
- Error on line 6: cvc-complex-type.3.2.2: Attribute "MyAttribute" must
not occur in element "MyType2".
I configured jDOM1 to use xerces:
SAXBuilder builder = new
I validated the same xml with the same xsd with oXygen (which also uses
xerces) and with some online validators. All told me that the xml is valid.
So my question is, why does the JAVA implementation gives tells me that
the xml is not valid.
I'm grateful for some hints.
More information about the jdom-interest