Page 1 of 1

@rowspan not found by Schematron rule in oXygen

Posted: Thu Jul 06, 2017 6:01 pm
by MaryS
Hi
Given the following XML (I'm validating against JATS 1.1 Archiving DTD):
...
<thead>
<tr>
<th rowspan="2">Year</th>
<th colspan="6" rowspan="1">
<italic>n</italic> (&#x0025;) by LFA</th>
<th rowspan="2">Overall</th>
</tr>
...

I have the following Schematron rule to check for the presence of @rowspan on <th>:

<sch:rule context="th[@rowspan]">
<sch:report test="true()">Don't use the rowspan attribute</sch:report>
</sch:rule>

However, this rule finds ALL <th>, not just those with @rowspan. For some odd reason, the same rule re-written as

<sch:rule context="th[@align]">
<sch:report test="true()">Don't use the align attribute</sch:report>
</sch:rule>

will successfully find ONLY those <th> with @align or @colspan, so this problem seems limited to @rowspan only. The same problem exists for evaluating @rowspan on <td>. I am using oXygen V 19 for PC. Note that there are no competing rules with the same context.

Is this a bug? I had the same problem in oXgen v 18.

Any advice appreciated.

Re: @rowspan not found by Schematron rule in oXgen

Posted: Thu Jul 06, 2017 6:26 pm
by adrian
Hi,

Note that in JATS 1.1 @rowspan and @colspan are default attributes (declared in the DTDs) for the th element.
You can check this in Oxygen, place the cursor inside the th element and have a look in the Attributes view. Even for th elements without explicit @rowspan and @colspan attributes in the XML you will still see them in the Attributes view with the default values of "1".

In short, all th elements have @rowspan and @colspan attributes, not just those that specify them explicitly, so the Schematron rule can't be used this way.

Regards,
Adrian

Re: @rowspan not found by Schematron rule in oXygen

Posted: Thu Jul 06, 2017 6:45 pm
by MaryS
OK that is good to know. But should I not then be able to test for th[@rowspan='2'], since this is not the default value? I have tried this actually, and it has no effect.

Re: @rowspan not found by Schematron rule in oXygen

Posted: Fri Jul 07, 2017 11:50 am
by tavy
Hello,

Yes, you can use th[@rowspan='2']. For me it works fine. You can also report a problem only when the value of the rowspan is different from the default one. Something like this:

Code: Select all


<sch:rule context="th[@rowspan!='1']">
<sch:report test="true()">Don't use the rowspan attribute</sch:report>
</sch:rule>
Best Regards,
Octavian