Page 1 of 1

Schematron and Oxygen 22.0

Posted: Tue Apr 07, 2020 4:13 pm
by david_himself

I've just started with ODD containing some elementary Schematron, generating a Relax NG XML file for validation of our TEI/XML files. For four members of our team the schema seems to work fine, but for one colleague, two rules in particular fire wrongly or fail to fire. We haven't spotted any difference in settings, but she's on vsn 22.0, while we're all on 21.1.

The prologue and start of the ODD file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="" xmlns:rng="" xml:lang="en" xmlns:sch="">

The misfiring rules look like this:

<elementSpec ident="p" module="core" mode="change">
<constraintSpec ident="header" scheme="schematron">
<sch:report test=".[@*]/ancestor::tei:teiHeader" role="error">A paragraph &lt;p&gt; in the header must not have any attributes.</sch:report>
<sch:report test=".[not(@rend)]/ancestor::tei:text" role="error">A paragraph &lt;p&gt; in the text portion must have the attribute rend.</sch:report>
<sch:report test="not(@rend='inline') and ./preceding-sibling::tei:label" role="warning">When the content of a postscript follows the &apos;P.S.&apos; label on the same line, its obligatory &lt;p&gt; would normally have @rend with value &quot;inline&quot;.</sch:report>

Of the three reports for <p>, the first throws an error for the colleague on 22.0 for every paragraph in the teiHeader, even though all are correctly written without an attribute; the second doesn't fire and allows <p> with or without @rend; while the third works as intended. All the other Schematron rules work fine for her as for us.

Any ideas where to look? Does the ODD need changing, or is there a setting in Oxygen we need to look at? Thanks for any help.

Re: Schematron and Oxygen 22.0

Posted: Wed Apr 08, 2020 12:18 pm
by Radu
Hi David,

In the Oxygen Preferences->"XML / XML Parser / RELAX NG" page there is an "Add default attributes" checkbox, if checked it will provide the support to expand default attributes (defined in the RNG) in the parsing stage, making it possible for the Schematron to match attributes which are not actually in the xml docs. Usually for TEI editing you should disable that checkbox.


Re: Schematron and Oxygen 22.0

Posted: Wed Apr 08, 2020 1:06 pm
by david_himself
Thanks, Radu. Unchecking that option fixed the problem for my colleague. I don't think the rest of us had it checked. I'm going to get rid of most or all default choices in the schema anyway, as they don't really help.