TEI Lite ODD shown by Oxygen as invalid?!

This should cover W3C XML Schema, Relax NG and DTD related problems.
ebouna
Posts: 1
Joined: Thu Jul 08, 2021 5:39 pm

TEI Lite ODD shown by Oxygen as invalid?!

Post by ebouna » Thu Jul 08, 2021 6:30 pm

I have just downloaded the TEI Lite ODD (tei_lite.odd) from https://tei-c.org/guidelines/customization/ to further modify the file in Oxygen. I have then opened the file in Oxygen. Oxygen, however, indicates that the ODD is invalid; it marks the <alternate> element in the following part of the code as erroneous:

Code: Select all

<elementSpec module="header" ident="editorialDecl" mode="change">
            <content>
              <alternate minOccurs="1" maxOccurs="unbounded">
                <classRef key="model.pLike"/>
              </alternate>
            </content>
            
            <!-- ... -->
            </elementSpec>
In addition, Oxygen displays the error message: "The alternate element must have at least two child elements."
I am wondering now if the ODD is really erroneous and if it is, with what version of TEI Lite Oxygen is working at the moment since no problem for me arises when I use the usual TEI Lite template to write an XML file conform to TEI Lite. I suppose Oxygen uses the TEI Lite Relax NG schema, but shouldn't this schema have a similar problem?

I am still new to customizing XML schemas: I would be glad for any advice how to fix the ODD.
Thanks in advance for any help.

Elias

Radu
Posts: 7594
Joined: Fri Jul 09, 2004 5:18 pm

Re: TEI Lite ODD shown by Oxygen as invalid?!

Post by Radu » Fri Jul 09, 2021 8:36 am

Hi Elias,

To validate the odd file Oxygen uses a RNG schema located inside its "frameworks" folder:

OXYGEN_INSTALL_DIR/frameworks/tei/xml/tei/custom/schema/relaxng/tei_odds.rng

Inside the RNG file there are extra Schematron checks which impose extra validation rules, and this check:

Code: Select all

<pattern xmlns="http://purl.oclc.org/dsdl/schematron"
                  id="tei_odds-alternate-alternatechilden-constraint-assert-17">
            <rule context="tei:alternate">
               <sch:assert xmlns:sch="http://purl.oclc.org/dsdl/schematron"
                           xmlns:rng="http://relaxng.org/ns/structure/1.0"
                           xmlns:xi="http://www.w3.org/2001/XInclude"
                           xmlns="http://www.tei-c.org/ns/1.0"
                           test="count(*)&gt;1">The alternate element must have at least two child elements</sch:assert>
            </rule>
         </pattern>
states that the "tei:alternate" element should have at least two child elements.
So Oxygen reports the error and the ODD is invalid according to the RNG schema we use for validation. We use the official TEI 4.1.0 schemas for validation.
Maybe you can try to ask more about this on the TEI users list as we do not know why the rule was added by the TEI maintainers, we just use the schemas provided by TEI.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply