LanguageMachines / libfolia

FoLiA library for C++
https://proycon.github.io/folia
GNU General Public License v3.0
15 stars 7 forks source link

missing processor not detected #51

Closed kosloot closed 1 year ago

kosloot commented 1 year ago

given this FoLiA:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="folia2html.xsl"?>
<FoLiA xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://ilk.uvt.nl/folia" xml:id="foo" version="2.1" generator="manual">
  <metadata type="native">
    <annotations>
      <division-annotation set="divs">
    <annotator processor="fubar"/>
      </division-annotation>
    </annotations>
  </metadata>
  <text xml:id="foo.text">
    <div xml:id="foo.div" class="chapter">
    </div>
  </text>
</FoLiA>

This is INVALID, because the processor ''fubar'' is never defined. But we happily parse this:

$ folialint tests/proctest.xml --nooutput Validated successfully: tests/proctest.xml

All other program based on libfolia will accept this

foliavalidator DOES reject it:

$ foliavalidator tests/proctest.xml Error on line 0: IDREF attribute processor references an unknown ID "fubar" VALIDATION ERROR against RelaxNG schema (stage 1/3), in tests/proctest.xml IDREF attribute processor references an unknown ID "fubar"