Be able to validate XR 2.0 and 1.2

This commit is contained in:
Jochen Stärk
2020-08-06 15:59:06 +02:00
parent 662307c0ba
commit 382435d0ba
12 changed files with 435 additions and 239699 deletions

View File

@@ -191,4 +191,25 @@ public class XMLValidatorTest extends ResourceCase {
}
public void testXRValidation() {
ValidationContext ctx = new ValidationContext(null);
XMLValidator xv = new XMLValidator(ctx);
XPathEngine xpath = new JAXPXPathEngine();
File tempFile = getResourceAsFile("validXRv2.xml");
try {
xv.setFilename(tempFile.getAbsolutePath());
xv.validate();
Source source = Input.fromString("<validation>" + xv.getXMLResult() + "</validation>").build();
String content = xpath.evaluate("/validation/summary/@status", source);
assertEquals("valid", content);
} catch (IrrecoverableValidationError e) {
// ignore, will be in XML output anyway
}
}
}