我想从 SAX-Parser 获取所有验证错误,但使用我的代码片段我只收到第一个。我怎样才能做到这一点?
谢谢!
片段
def factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI)
def xml = new StreamSource(inputStream)
def xsd = new StreamSource(new FileReader(schema), systemId)
try {
factory?.newSchema(xsd)?.newValidator()?.validate(xml)
} catch(SAXParseException saxpe) {
continueImport = false
log.error("Error while parsing the import xml", saxpe)
}