NOTE: none of the changes made by XMLmind predates the interchange of DocBook
5.2 documents created or edited using XMLmind XML Editor with other XML
software.



* Because XMLmind XML Editor native schematron processor only support
  queryBinding="xslt" and not queryBinding="xslt2", modified assembly.sch,
  docbook.sch as follows:
  
diff -u assembly.sch.ORI assembly.sch
---
--- assembly.sch.ORI    2023-07-19 18:00:00.000000000 +0200
+++ assembly.sch        2023-12-08 16:57:18.522129496 +0100
@@ -10,14 +10,19 @@
 <s:schema xmlns:db="http://docbook.org/ns/docbook"
            xmlns:rng="http://relaxng.org/ns/structure/1.0"
            xmlns:s="http://purl.oclc.org/dsdl/schematron"
-           queryBinding="xslt2">
+           xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+           queryBinding="xslt">
    <s:ns prefix="db" uri="http://docbook.org/ns/docbook"/>
    <s:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
    <s:ns prefix="trans" uri="http://docbook.org/ns/transclusion"/>
+   <xslt:key name="callout-targets"
+             match="db:areaset/@xml:id|db:area/@xml:id|db:co/@xml:id" use="."/>
    <s:pattern>
       <s:title>Callout cross reference constraint</s:title>
       <s:rule context="db:callout[@arearefs]">
-         <s:assert test="every $id in tokenize(current()/@arearefs) satisfies (every $ar in //*[@xml:id = $id] satisfies (local-name($ar) = ('areaset', 'area', 'co') and namespace-uri($ar) = 'http://docbook.org/ns/docbook'))">@arearefs on callout must point to a areaset, area, or co.</s:assert>
+         <s:let name="refs" value="tokenize(@arearefs, '\s+')" />
+         <s:let name="targets" value="key('callout-targets', $refs)" />
+         <s:assert test="count($targets) = count($refs)">@arearefs on callout must point to a areaset, area, or co.</s:assert>
       </s:rule>
    </s:pattern>
    <s:pattern>
---

diff -u docbook.sch.ORI docbook.sch
---
--- docbook.sch.ORI     2023-07-19 18:00:00.000000000 +0200
+++ docbook.sch 2023-12-08 16:56:31.077960731 +0100
@@ -10,14 +10,19 @@
 <s:schema xmlns:db="http://docbook.org/ns/docbook"
            xmlns:rng="http://relaxng.org/ns/structure/1.0"
            xmlns:s="http://purl.oclc.org/dsdl/schematron"
-           queryBinding="xslt2">
+           xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+           queryBinding="xslt">
    <s:ns prefix="db" uri="http://docbook.org/ns/docbook"/>
    <s:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
    <s:ns prefix="trans" uri="http://docbook.org/ns/transclusion"/>
+   <xslt:key name="callout-targets"
+             match="db:areaset/@xml:id|db:area/@xml:id|db:co/@xml:id" use="."/>
    <s:pattern>
       <s:title>Callout cross reference constraint</s:title>
       <s:rule context="db:callout[@arearefs]">
-         <s:assert test="every $id in tokenize(current()/@arearefs) satisfies (every $ar in //*[@xml:id = $id] satisfies (local-name($ar) = ('areaset', 'area', 'co') and namespace-uri($ar) = 'http://docbook.org/ns/docbook'))">@arearefs on callout must point to a areaset, area, or co.</s:assert>
+         <s:let name="refs" value="tokenize(@arearefs, '\s+')" />
+         <s:let name="targets" value="key('callout-targets', $refs)" />
+         <s:assert test="count($targets) = count($refs)">@arearefs on callout must point to a areaset, area, or co.</s:assert>
       </s:rule>
    </s:pattern>
    <s:pattern>
---

xmltool schematron -iso assembly.sch

xmltool schematron -iso docbook.sch



* edit_rng.xslt contains comments describing the modifications made to the
standard RELAX NG schema. Modified assembly.rng, docbook.rng as follows:

java -cp ~/src/11xxe/bin/saxon.jar com.icl.saxon.StyleSheet -o assembly.rng assembly.rng.ORI CHANGES_MADE_BY_XMLMIND/edit_rng.xslt

xmltool validate -s assembly.rng

rm -rf assembly_doc2 ; xmltool schemadoc -xxe assembly.rng assembly_doc2

java -cp ~/src/11xxe/bin/saxon.jar com.icl.saxon.StyleSheet -o docbook.rng docbook.rng.ORI CHANGES_MADE_BY_XMLMIND/edit_rng.xslt

  Then replaced:

      <define name="db.book.info">
         <ref name="db._info"/>
      </define>

  by:

      <define name="db.book.info">
        <!-- XMLmind: was:
             <ref name="db._info"/>
             but we want a book to have a title in all cases.
        -->
        <ref name="db._info.title.req"/>
      </define>

xmltool validate -s docbook.rng

rm -rf docbook_doc2 ; xmltool schemadoc -xxe docbook.rng docbook_doc2

rm -rf assembly_doc2 docbook_doc2
