]> granicus.if.org Git - docbook-dsssl/commitdiff
Move termdef into glossary.rnc; fix content model ambiguity, add a Schematron rule...
authorNorman Walsh <ndw@nwalsh.com>
Sun, 3 Apr 2005 21:53:26 +0000 (21:53 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sun, 3 Apr 2005 21:53:26 +0000 (21:53 +0000)
docbook/relaxng/src/glossary.rnc
docbook/relaxng/src/pool.rnc

index 432bb69479cbf6c3f54969eccdd0ea86cb68116e..e4c42465dc827351bdbf9c41de56382eebcb567f 100644 (file)
@@ -15,7 +15,7 @@ namespace s = "http://www.ascc.net/xml/schematron"
 namespace db = "http://docbook.org/docbook-ng"
 default namespace = "http://docbook.org/docbook-ng"
 
-db.general.inlines |= db.glossary.inlines
+db.publishing.inlines |= db.glossary.inlines
 db.list.blocks |= db.glosslist
 db.navigation.components |= db.glossary
 
@@ -293,4 +293,33 @@ div {
       }
 }
 
+# ======================================================================
+
+[
+   db:refname [ "termdef" ]
+   db:refpurpose [ "An inline definition of a term" ]
+]
+div {
+   db.termdef.role.attribute = attribute role { text }
+
+   db.termdef.attlist =
+      db.termdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.baseform.attribute
 
+   db.termdef =
+      [
+         s:rule [
+            context = "db:termdef"
+            s:assert [
+               test = "count(db:glossterm) != 1"
+               "A termdef must contain a glossterm"
+            ]
+         ]
+      ]
+      element termdef {
+         db.termdef.attlist,
+         db.all.inlines*
+      }
+}
index 0b4136abcd52f21f703e3abd55a376082bcb73ad..6562ab7ea622c00fbd9634580bee8001876c9dbe 100644 (file)
@@ -1845,28 +1845,6 @@ div {
 
 # ======================================================================
 
-[
-   db:refname [ "termdef" ]
-   db:refpurpose [ "An inline definition of a term" ]
-]
-div {
-
-   db.termdef.role.attribute = attribute role { text }
-
-   db.termdef.attlist =
-      db.termdef.role.attribute?
-    & db.common.attributes
-    & db.common.linking.attributes
-
-   db.termdef =
-      element termdef {
-         db.termdef.attlist,
-         (db.all.inlines* & db.glossterm)
-      }
-}
-
-# ======================================================================
-
 [
    db:refname [ "example" ]
    db:refpurpose [ "A formal example, with a title" ]