Bastl
Bastl

Reputation: 2996

SAXParseExceptions: catalog of cvc-errors

Where are the possible XSD-schema validation errors defined?

I am writing a SAX-ErrorHandler and want to deal with them systematically: e.g.

public void error(SAXParseException e) throws SAXException {
    if (e.getMessage().startsWith("cvc-pattern-valid:")) {
      .. custom handling, perhaps ignoring ..
    } else if (e.getMessage().startsWith("cvc-type.3.1.3:")) {
      .. custom handling, perhaps ignoring ..
    } else {
        throw (e);
    }
}

Any better way to deal with the real error is appreciated too.

Upvotes: 2

Views: 1510

Answers (1)

Petru Gardea
Petru Gardea

Reputation: 21638

Please take a look here; it also explains how the numbers come about, etc.

Upvotes: 2

Related Questions