Open eduarddrenth opened 3 years ago
Written this junit test for it:
@Test
public void testValidation() throws IOException, SchematronException {
String xml = new String(Files.readAllBytes(new File("src/test/resources/achter.xml").toPath()));
String xmlnok = new String(Files.readAllBytes(new File("src/test/resources/fout.xml").toPath()));
Schematron schematron = Schematron.newInstance(new SAXSource(new InputSource(
SchematronHelper.class.getResourceAsStream("/schematron/tei_dictionaries.sch"))));
Result result = schematron.validate(new SAXSource(new InputSource(new StringReader(xml))));
if (!result.isValid()) {
Assert.fail("should be valid: " + result.getValidationMessages().toString());
}
result = schematron.validate(new SAXSource(new InputSource(new StringReader(xmlnok))));
if (result.isValid()) {
Assert.fail("should not be valid");
}
}
does not matter to load schematron from filesystem. It could be (not) inherited maven dependencies causing the lib with the xslt not being included => NO, THAT"S NOT IT
Test runs fine on master branch
Test runs fine in 204 branche as well. Must be something with the way I depend on schxslt from my own project
Validation succeeds, error message remains but does not influence validation.
Perhaps something in the xslt's and the way saxonica pick that up leads to Premature end of file
Are you using a custom URI resolver?
no, and #resolve isn't called, checked that in debugging
I am struggling with this error:
schematron is loaded from jar, perhaps related to #4
Did not pinpoint the problem yet