XMLParserUtils.addExternalSchemaURL(dp,ns[i],schema[i].toExternalForm());
}
try {
InputSource is = new InputSource(doc.openStream());
is.setSystemId(doc.toExternalForm());
xr.setErrorHandler(new FailOnErrorErrorHandler());
xr.parse(is);
} catch (SAXException se) {
if (succeed) {
fail("SAX validation of " + doc.toExternalForm() + " should have succeeded; " +
"instead, got: " + se.getMessage());
}
return;
}
if (!succeed) {
fail("SAX validation of " + doc.toExternalForm() + " should have failed.");
}
try {
InputSource is = new InputSource(doc.openStream());
is.setSystemId(doc.toExternalForm());
dp.setErrorHandler(new FailOnErrorErrorHandler());
dp.parse(is);
} catch (SAXException se) {
if (succeed) {
fail("DOM validation of " + doc.toExternalForm() + " should have succeeded; " +
"instead, got: " + se.getMessage());