Any guess why an DocumentBuilder parses an XML fine but it does not catch the schema contraint error. When I put a malformed xml it catches the problem. But when I remove a required attribute it is fine. I have setAttribute with XMLSchema and XSD. Please hint on common mistakes.