@rowspan not found by Schematron rule in oXygen
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 2
- Joined: Thu Jul 06, 2017 5:46 pm
@rowspan not found by Schematron rule in oXygen
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> (%) 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.
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> (%) 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.
Last edited by MaryS on Thu Jul 06, 2017 6:41 pm, edited 1 time in total.
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: @rowspan not found by Schematron rule in oXgen
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
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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: @rowspan not found by Schematron rule in oXygen
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:
Best Regards,
Octavian
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>
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service