From 3e9345b5ff08a74bb0b8f1d6e090778c39d93cbf Mon Sep 17 00:00:00 2001 From: Norman Walsh Date: Sun, 3 Apr 2005 21:53:26 +0000 Subject: [PATCH] Move termdef into glossary.rnc; fix content model ambiguity, add a Schematron rule to require glossterm in termdef --- docbook/relaxng/src/glossary.rnc | 31 ++++++++++++++++++++++++++++++- docbook/relaxng/src/pool.rnc | 22 ---------------------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/docbook/relaxng/src/glossary.rnc b/docbook/relaxng/src/glossary.rnc index 432bb6947..e4c42465d 100644 --- a/docbook/relaxng/src/glossary.rnc +++ b/docbook/relaxng/src/glossary.rnc @@ -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* + } +} diff --git a/docbook/relaxng/src/pool.rnc b/docbook/relaxng/src/pool.rnc index 0b4136abc..6562ab7ea 100644 --- a/docbook/relaxng/src/pool.rnc +++ b/docbook/relaxng/src/pool.rnc @@ -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" ] -- 2.40.0