JATS4R / jats-schematrons

JATS4R Schematrons
https://jats-schematrons.vercel.app/
8 stars 4 forks source link

Remove "value-of" from output messages #4

Closed hubgit closed 5 years ago

hubgit commented 5 years ago

When the list of validations is shown to the user, those which have passed have a message that sometimes looks like "The copyright year should have 4 digits, instead of "2019"", which is confusing.

It would make more sense if it just said "The copyright year should have 4 digits", as we can already show the relevant line of the XML.

jeffbeckncbi commented 5 years ago

The value-of in the messages is supposed to report what is wrong.

Do you have an issue with processing the value-of (it doesn't look like it) or just that it is giving you bad messages? I'd like to be able to customize the messages to the content. I'll review the value-ofs throughout and make sure that they are reporting what I would expect. If I can't get them to work right, then I'll remove them all

And, of course, if you have trouble processing them, I'll remove them all.

jeffbeckncbi commented 5 years ago

The value-of in the copyright error message is working as I expect it to when I run the Schematrons with Oxygen. It should only be reporting values less than 1000 or greater than 10000. If you are seeing "2019" reported in this error message, then we might have a problem with hour the schematron processor is applying this test.

hubgit commented 5 years ago

The problem is not with the message when it finds a problem, e.g. "The copyright year should have 4 digits, instead of "20019"", but when it doesn't find a problem, e.g. "The copyright year should have 4 digits, instead of "2019"".

hubgit commented 5 years ago

There is also the issue that support for value-of isn't yet complete in schematron-runner, but that is at least solvable either by finishing the implementation or using a different runner.

jeffbeckncbi commented 5 years ago

I think we might have a larger problem with how the schematrons are being run. II finally got some time to run the validator on the J4R site from outside of our network. This year test is a good example. The way that the schematron is supposed to work is that when this year testf doesn't find a problem (when the year is a 4-digit number), then there should be no output at all. The value-of should only report the value of the element when there is a problem.

<assert test="number() and number() > 999 and number() &lt; 10000">

If the test in an assert is true, then nothing should be reported because the Schematron writer is asserting that this iXPATH must be true.

I found other issues where the schematrons are not acting as expected. I'll make up some test files that are easy to understand and add them in a samples directory under jats-schematrons.

General validator issues moved to jats-validator

hubgit commented 5 years ago

The way that the schematron is supposed to work is that when this year testf doesn't find a problem (when the year is a 4-digit number), then there should be no output at all. The value-of should only report the value of the element when there is a problem.

Ok, that's interesting and potentially makes this issue irrelevant - I'll investigate. Wouldn't it still be useful to have a description of the test that passed, though?

hubgit commented 5 years ago

The tests that I did get to report are assigning ERROR as WARNING. Do I need to separate those in the jats4r.sch again.

The phases should be controlling which tests are assigned as errors or warnings.

jeffbeckncbi commented 5 years ago

Wouldn't it still be useful to have a description of the test that passed, though?

I think no. In order to find the right "wrong" thing, we need to test lots of places. Reporting asserts tat are true or reports that are false will just get really confusing.

hubgit commented 5 years ago

Fair enough, no need to worry about this then.