JATS4R / JATS4R-Participant-Hub

The hub for all JATS4R meeting notes, examples, draft recommendations, documents, and issues.
http://jats4r.org
17 stars 20 forks source link

Error or warning for missing JATS4R <?xml-model?> processing instruction #114

Closed Klortho closed 8 years ago

Klortho commented 8 years ago

I'm working on the validator now, and adding the feature for it to check that the JATS4R processing instruction is in the document, per the discussion in issue #10. I.e. every document should have this at the top:

<?xml-model href="http://jats4r.org/schema/1.0/jats4r.sch"
    schematypens="http://purl.oclc.org/dsdl/schematron"?>

I am thinking it should be a warning, not an error. If it's not present, the validator will check against the latest version of our recommendations. How does that sound?

hubgit commented 8 years ago

Do you know of any tools that make use of the xml-model instruction (to help with predicting what effect adding it will have)?

hubgit commented 8 years ago

I note that http://jats4r.org/schema/1.0/jats4r.sch doesn't currently resolve - is the plan to put the schema at that URL? If so, should it use https as the protocol?

Klortho commented 8 years ago

I note that http://jats4r.org/schema/1.0/jats4r.sch doesn't currently resolve

No, but http://jats4r.org/schema/0.1/jats4r.sch does. Yes, the plan is to put the schematron files there -- and the deploy script already does it. I'm actually coding the validator to look for the version number, and validate against the correct version of JATS4R.

Do you know of any tools that make use of the xml-model instruction?

oXygen does. I've tested that it works with schematron validation, and it works. One gotcha, that we noticed on the other ticket, is that if this PI exists, then oxygen won't, by default, to dtd validation. I don't know about other tools.

hubgit commented 8 years ago

One gotcha, that we noticed on the other ticket, is that if this PI exists, then oxygen won't, by default, do dtd validation.

I don't really know much about this, but might adding a group attribute be useful to stop the schema being applied by default?

Klortho commented 8 years ago

I tried it today, and the behavior is different from what I wrote yesterday. I must have been doing something wrong.

I tried it in oxygen 17, with this:

<?xml-model href="http://jats4r.org/schema/0.1/jats4r.sch"
   schematypens="http://purl.oclc.org/dsdl/schematron" title="JATS4R 0.1"?>
<!DOCTYPE article 
  PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.0 20120330//EN"
  "http://jats.nlm.nih.gov/publishing/1.0/JATS-journalpublishing1.dtd">

It is definitely doing both validations. Adding a group pseudo-attribute didn't change anything.

Klortho commented 8 years ago

We decided to remove this, because of its potential to interfere with other xml-model pis, if they exist.