Menu

#307 Issues with Docbook 5.1 CR3 RNG-based schemas

v5.1
closed
nobody
None
5
2015-09-24
2015-07-01
Radu Coravu
No

A couple of problems in Schematron files shipped with the Docbook 5.1 CR3 RNG-based schemas:

1) All ISO Schematron patterns (both in the separate Schematron files and in the Schematron embedded in the RNGs) have a @name attribute set to them. This is invalid according to the ISO schematron specs, it should probably be converted to a element inside the <pattern> element.</p> <p>You can use regular expression find/replace by searching for:</p> <p><s:pattern name="(.*?)"></p> <p>and replacing with:</p> <p><s:pattern><br> <s:title>$1</s:title></p> <p>2) The "assembly.sch" has two asserts:</p> <p><s:rule context="db:structure"><br> <s:assert test="@renderas and db:output/@renderas">The renderas attribute can be specified on either the structure or output, but not both.</s:assert><br> </s:rule><br> <s:rule context="db:module"><br> <s:assert test="@renderas and db:output/@renderas">The renderas attribute can be specified on either the structure or output, but not both.</s:assert><br> </s:rule></p> <p>which should either be negated in the XPath expression or renamed to <s:report>.</p> <p>3) The catalog.xml does not contain mappings for assembly schemas and schematron files like for example:</p> <p><uri name="http://docbook.org/xml/5.1/rng/assembly.rng" uri="rng/assembly.rng"/><br> <uri name="http://docbook.org/xml/5.1/sch/assembly.sch" uri="sch/assembly.sch"/></p>

Discussion

  • Radu Coravu

    Radu Coravu - 2015-07-01

    It seems that because I used XML elements most of my post is gone and it also seems that I cannot edit my own post.
    So I will repeat:

    A couple of problems in Schematron files shipped with the Docbook 5.1 CR3 RNG-based schemas:

    1) All ISO Schematron patterns (both in the separate Schematron files and in the Schematron embedded in the RNGs) have a @name attribute set to them. This is invalid according to the ISO schematron specs, it should probably be converted to a "title" element. You can fix this by running a regular expression like:

     <s:pattern name="(.*?)">
    

    and replacing with:

    <s:pattern>
       <s:title>$1</s:title>
    

    2) The Schematron file assembly.sch has two rules:

      <s:rule context="db:structure">
         <s:assert test="@renderas and db:output/@renderas">The renderas attribute can be specified on either the structure or output, but not both.</s:assert>
      </s:rule>
      <s:rule context="db:module">
         <s:assert test="@renderas and db:output/@renderas">The renderas attribute can be specified on either the structure or output, but not both.</s:assert>
      </s:rule>
    

    which should either have the XPath negated or be renamed to "s:report"

    3) The catalog.xml contains no mappings for the assembly schemas and schematrons.

     
  • Norman Walsh

    Norman Walsh - 2015-08-14

    Thanks. I've corrected these errors for the next release, hopefully today or Monday.

     
  • Radu Coravu

    Radu Coravu - 2015-08-18

    Thanks Norm.

     
  • Norman Walsh

    Norman Walsh - 2015-09-24
     
  • Norman Walsh

    Norman Walsh - 2015-09-24
    • status: open --> closed
     

Log in to post a comment.