TEIC / TEI

The Text Encoding Initiative Guidelines
https://www.tei-c.org
Other
268 stars 88 forks source link

Schematron validation issue, " Internal error evaluating template rule" #2507

Open bansp opened 7 months ago

bansp commented 7 months ago

I am not able to supply more at this point but thought I'd at least signal something that looks strange, especially given that the calendar issue has only freshly been fixed (iirc):

Upon trying to validate a document against its RNG, I get an error that I haven't seen before: oXygen just says:

System ID: /home/piotr/projects/ISOTC37/MAF/MAF-1_examples.xml Main validation file: /home/piotr/projects/ISOTC37/MAF/MAF-1_examples.xml Schema: /home/piotr/projects/ISOTC37/MAF/MAF-1.rng Engine name: ISO Schematron Severity: fatal Description: Internal error evaluating template rule at line 271 in module file:/home/piotr/projects/ISOTC37/MAF/MAF-1.rng

The fragment at line 271 is:

        <attribute name="calendar">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates one or more systems or calendars to which the date represented by the content of this element belongs.</a:documentation>
            <list>
               <oneOrMore>
                  <data type="anyURI">
                     <param name="pattern">\S+</param>
                  </data>
               </oneOrMore>
            </list>
         </attribute>

And it's all weird, because before I got to this stage, I had had several Schematron constraints in the ODD, and with those constraints, the parser was pointing at line 283, at which a constraint is sitting:

<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
            id="MAF-1-att.datable-calendar-calendar-constraint-rule-4">
      <sch:rule xmlns:rng="http://relaxng.org/ns/structure/1.0"
                xmlns:sch="http://purl.oclc.org/dsdl/schematron"
                xmlns:xi="http://www.w3.org/2001/XInclude"
                xmlns="http://www.tei-c.org/ns/1.0"
                context="tei:*[@calendar]">
            <sch:assert test="string-length( normalize-space(.) ) gt 0"> @calendar indicates one or more
            systems or calendars to which the date represented by the content of this element belongs,
            but this <sch:name/> element has no textual content.</sch:assert>
          </sch:rule>
   </pattern>

And I'm getting a feeling that those line numbers are not worth much. Not sure how I can debug the Schematron engine better, can't find any such options in oXygen.

Aha, the ODD has been freshly processed with Roma, except Roma claims to be using version 4.6.0.

Schema generated from ODD source 2023-11-20T23:05:07Z. . TEI Edition: Version 4.6.0. Last updated on 4th April 2023, revision f18deffba TEI Edition Location: https://www.tei-c.org/Vault/P5/Version 4.6.0/

Can I be accidentally hitting the "calendar issue" simply because it's 4.6.0 in Roma still?

peterstadler commented 7 months ago

Can I be accidentally hitting the "calendar issue" simply because it's 4.6.0 in Roma still?

Yes, that might be the case. I updated TEIGarage just now with the 4.7.0 TEI sources but needed to downgrade Stylesheets version to v7.55.0, see https://github.com/TEIC/tei-converter/issues/5.

Could you try again, please?

peterstadler commented 4 months ago

@bansp I think the issue was caused by a temporary incompatibility between Stylesheets and TEIGarage/Roma which produced a corrupt schema. Could you please try again to process your ODD and test the validation?

bansp commented 4 months ago

Hi @peterstadler , thanks for calling out. I can't afford the time right now but I'll do my best to keep it in my sights. I need to be back at that project in March at the latest.