Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when validating #51

Open
eduarddrenth opened this issue Oct 15, 2020 · 7 comments
Open

error when validating #51

eduarddrenth opened this issue Oct 15, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@eduarddrenth
Copy link
Contributor

I am struggling with this error:

Error 
   Error reported by XML parser processing
  jar:file:/home/eduard/.m2/repository/name/dmaus/schxslt/java/2.0.4/java-2.0.4.jar!/name/dmaus/schxslt/: Premature end of file.: Premature end of file.

schematron is loaded from jar, perhaps related to #4

Did not pinpoint the problem yet

@eduarddrenth
Copy link
Contributor Author

eduarddrenth commented Oct 15, 2020

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");
        }
    }

@eduarddrenth
Copy link
Contributor Author

eduarddrenth commented Oct 15, 2020

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

@eduarddrenth
Copy link
Contributor Author

Test runs fine on master branch

@eduarddrenth
Copy link
Contributor Author

Test runs fine in 204 branche as well. Must be something with the way I depend on schxslt from my own project

@eduarddrenth
Copy link
Contributor Author

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

@dmj dmj added the bug Something isn't working label Oct 15, 2020
@dmj
Copy link
Member

dmj commented Oct 15, 2020

Are you using a custom URI resolver?

@eduarddrenth
Copy link
Contributor Author

no, and #resolve isn't called, checked that in debugging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants