【问题标题】:SAXParseExceptions: catalog of cvc-errorsSAXParseExceptions:cvc 错误目录
【发布时间】: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);
    }
}

任何更好的方法来处理真正的错误也是值得赞赏的。

【问题讨论】:

    标签: java xml xsd sax


    【解决方案1】:

    请看here;它还解释了数字是如何产生的,等等。

    【讨论】:

    • 太好了,我正在浏览文档,但没有找到!
    猜你喜欢
    • 2015-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-06
    • 2013-04-12
    相关资源
    最近更新 更多