【发布时间】:2012-02-15 10:56:59
【问题描述】:
在哪里定义了可能的 XSD 架构验证错误?
我正在编写一个 SAX-ErrorHandler 并希望系统地处理它们:例如
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);
}
}
任何更好的方法来处理真正的错误也是值得赞赏的。
【问题讨论】: