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

foliavalidator gives Uninformative message on missing version #6

Open
kosloot opened this issue May 23, 2019 · 3 comments
Open

foliavalidator gives Uninformative message on missing version #6

kosloot opened this issue May 23, 2019 · 3 comments
Assignees

Comments

@kosloot
Copy link
Collaborator

kosloot commented May 23, 2019

test file:

<?xml version="1.0" encoding="UTF-8"?>
<FoLiA xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://ilk.uvt.nl/folia" xml:id="doc" generator="libfolia-v0.11">
  <metadata type="native">
    <annotations/>
  </metadata>
  <text xml:id="text">
    <p xml:id="p1">
      <t>Een tekst.</t>
    </p>
  </text>
</FoLiA>

The validator complains:

Error on line 0: Element FoLiA failed to validate attributes
VALIDATION ERROR against RelaxNG schema (stage 1/3), in empty2.xml
Element FoLiA failed to validate attributes

libfolia/folialint DOES accept this file, but will add a bogus version value of 1.4.987

I would expect a more informative message, like:
Element FoLiA failed: missing 'version' attribute


@proycon
Copy link
Owner

proycon commented May 23, 2019

Hmm yeah, the validator actually does three stages, first it simply invokes the RelaxNG stylesheet, which produced messages like this. Only if that passes it processes the document with the library. The last stage is a serialisation check. If you want to do only library validation you can pass the --quick option, which should produce a better error too.

For FoLiA v2, the version attribute is mandatory.

@proycon proycon self-assigned this May 23, 2019
@kosloot
Copy link
Collaborator Author

kosloot commented May 23, 2019

But that means that pre folia2.0 document that lack a version are always rejected.
That's why I introduced the bogus value.

@proycon
Copy link
Owner

proycon commented May 23, 2019

Ah right, that makes sense yes. I might need to do that too then,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants