我想提供我自己在 中完成的验证的消息DocumentBuilder,而不是来自XMLMessages.properties.
现在我看到error-reporter需要将一个属性设置为扩展的类XMLErrorReporter。
但是,我无法ComponentManager从Document/ Builder/获取Factory。
解析字符串SAXParseException是最后的选择,但我只是认为可能有一种“最佳实践”的方法。
我想提供我自己在 中完成的验证的消息DocumentBuilder,而不是来自XMLMessages.properties.
现在我看到error-reporter需要将一个属性设置为扩展的类XMLErrorReporter。
但是,我无法ComponentManager从Document/ Builder/获取Factory。
解析字符串SAXParseException是最后的选择,但我只是认为可能有一种“最佳实践”的方法。
have you already looked at DocumentBuilder#setErrorHandler?
if yes, could you explain why this approach doesn't work for you?