From 787f8f9999933221a50975482c9ff0c1bb30b4a4 Mon Sep 17 00:00:00 2001 From: Norman Walsh Date: Wed, 6 Jul 2005 20:12:01 +0000 Subject: [PATCH] Fix totally bogus patterns for optional/required section elements at various levels --- docbook/relaxng/docbook/src/hier.rnc | 23 ++++-------- docbook/relaxng/docbook/src/refentry.rnc | 24 +++++-------- docbook/relaxng/docbook/src/refsect1.rnc | 6 ++-- docbook/relaxng/docbook/src/sect1.rnc | 45 ++++++++++++------------ 4 files changed, 39 insertions(+), 59 deletions(-) diff --git a/docbook/relaxng/docbook/src/hier.rnc b/docbook/relaxng/docbook/src/hier.rnc index 92fa03b75..a19545ef6 100644 --- a/docbook/relaxng/docbook/src/hier.rnc +++ b/docbook/relaxng/docbook/src/hier.rnc @@ -60,22 +60,15 @@ db.label.attribute = attribute label { text } # ====================================================================== -db.toplevel.optional.sections = (db.section*, db.simplesect*) - -db.toplevel.required.sections = (db.section+, db.simplesect*) | db.simplesect+ +db.toplevel.sections = (db.section+, db.simplesect*) | db.simplesect+ db.toplevel.blocks.or.sections = - (db.all.blocks+, db.toplevel.optional.sections) | db.toplevel.required.sections - -db.recursive.optional.sections = (db.section*, db.simplesect*) + (db.all.blocks+, db.toplevel.sections?) | db.toplevel.sections -db.recursive.required.sections = (db.section+, db.simplesect*) | db.simplesect+ +db.recursive.sections = (db.section+, db.simplesect*) | db.simplesect+ db.recursive.blocks.or.sections = - (db.all.blocks+, db.recursive.optional.sections) | db.recursive.required.sections - -db.optional.refentry = notAllowed -db.required.refentry = notAllowed + (db.all.blocks+, db.recursive.sections?) | db.recursive.sections # ====================================================================== @@ -450,8 +443,7 @@ div { # ====================================================================== -db.article.optional.components = db.section* | db.simplesect* -db.article.required.components = db.section+ | db.simplesect+ +db.article.components = (db.section+, db.simplesect*) | db.simplesect+ # ====================================================================== @@ -526,9 +518,8 @@ div { db.article.attlist, db.article.info, db.navigation.components*, - ((db.all.blocks+, - db.article.optional.components) - | db.article.required.components), + ((db.all.blocks+, db.article.components?) + | db.article.components), (db.appendix | db.navigation.components | db.ackno | db.colophon)* } } diff --git a/docbook/relaxng/docbook/src/refentry.rnc b/docbook/relaxng/docbook/src/refentry.rnc index 83395d157..34652b413 100644 --- a/docbook/relaxng/docbook/src/refentry.rnc +++ b/docbook/relaxng/docbook/src/refentry.rnc @@ -22,23 +22,15 @@ db.divisions |= db.reference db.part.components |= db.refentry | db.reference -db.article.optional.components |= db.refentry* -db.article.required.components |= db.refentry+ +db.article.components |= db.refentry+ -db.toplevel.optional.sections |= db.refentry* -db.toplevel.required.sections |= db.refentry+ +db.toplevel.sections |= db.refentry+ -db.recursive.optional.sections |= db.refentry* -db.recursive.required.sections |= db.refentry+ +db.recursive.sections |= db.refentry+ -db.optional.refentry |= db.refentry* -db.required.refentry |= db.refentry+ +db.toplevel.refsection = db.refsection+ -db.toplevel.optional.refsection = db.refsection* -db.toplevel.required.refsection = db.refsection+ - -db.secondlevel.optional.refsection = db.refsection* -db.secondlevel.required.refsection = db.refsection+ +db.secondlevel.refsection = db.refsection+ # ====================================================================== @@ -95,7 +87,7 @@ div { db.refmeta?, db.refnamediv+, db.refsynopsisdiv?, - db.toplevel.required.refsection + db.toplevel.refsection } } @@ -283,8 +275,8 @@ div { element refsynopsisdiv { db.refsynopsisdiv.attlist, db.refsynopsisdiv.info, - ((db.all.blocks+, db.secondlevel.optional.refsection) - | db.secondlevel.required.refsection) + ((db.all.blocks+, db.secondlevel.refsection?) + | db.secondlevel.refsection) } } diff --git a/docbook/relaxng/docbook/src/refsect1.rnc b/docbook/relaxng/docbook/src/refsect1.rnc index c5c49aba0..dc4b009e5 100644 --- a/docbook/relaxng/docbook/src/refsect1.rnc +++ b/docbook/relaxng/docbook/src/refsect1.rnc @@ -16,11 +16,9 @@ namespace s = "http://www.ascc.net/xml/schematron" namespace db = "http://docbook.org/ns/docbook" default namespace = "http://docbook.org/ns/docbook" -db.toplevel.optional.refsection |= db.refsect1* -db.toplevel.required.refsection |= db.refsect1+ +db.toplevel.refsection |= db.refsect1+ -db.secondlevel.optional.refsection |= db.refsect2* -db.secondlevel.required.refsection |= db.refsect2+ +db.secondlevel.refsection |= db.refsect2+ # ====================================================================== diff --git a/docbook/relaxng/docbook/src/sect1.rnc b/docbook/relaxng/docbook/src/sect1.rnc index 66c3bf109..aa8a54ea6 100644 --- a/docbook/relaxng/docbook/src/sect1.rnc +++ b/docbook/relaxng/docbook/src/sect1.rnc @@ -16,14 +16,14 @@ namespace s = "http://www.ascc.net/xml/schematron" namespace db = "http://docbook.org/ns/docbook" default namespace = "http://docbook.org/ns/docbook" -db.toplevel.optional.sections |= (db.sect1*, db.simplesect*) -db.toplevel.required.sections |= (db.sect1+, db.simplesect*) | db.simplesect+ +db.toplevel.sections |= (db.sect1+, db.simplesect*) | db.simplesect+ -db.article.optional.components |= (db.sect1*, db.simplesect*) -db.article.required.components |= (db.sect1+, db.simplesect*) | db.simplesect+ +db.article.components |= (db.sect1+, db.simplesect*) | db.simplesect+ # ====================================================================== +db.sect1.sections = (db.sect2+, db.simplesect*) | db.simplesect+ + [ db:refname [ "sect1" ] db:refpurpose [ "A top-level section of document" ] @@ -47,16 +47,16 @@ div { element sect1 { db.sect1.attlist, db.sect1.info, - ((db.all.blocks+, (db.optional.refentry | (db.sect2*, db.simplesect*))) - | db.required.refentry - | (db.sect2+, db.simplesect*) - | db.simplesect+), + ((db.all.blocks+, db.sect1.sections?) + | db.sect1.sections), db.navigation.components* } } # ====================================================================== +db.sect2.sections = (db.sect3+, db.simplesect*) | db.simplesect+ + [ db:refname [ "sect2" ] db:refpurpose [ "A subsection within a Sect1" ] @@ -80,16 +80,16 @@ div { element sect2 { db.sect2.attlist, db.sect2.info, - ((db.all.blocks+, (db.optional.refentry | (db.sect3*, db.simplesect*))) - | db.required.refentry - | (db.sect3+, db.simplesect*) - | db.simplesect+), + ((db.all.blocks+, db.sect2.sections?) + | db.sect2.sections), db.navigation.components* } } # ====================================================================== +db.sect3.sections = (db.sect4+, db.simplesect*) | db.simplesect+ + [ db:refname [ "sect3" ] db:refpurpose [ "A subsection within a Sect2" ] @@ -113,16 +113,16 @@ div { element sect3 { db.sect3.attlist, db.sect3.info, - ((db.all.blocks+, (db.optional.refentry | (db.sect4*, db.simplesect*))) - | db.required.refentry - | (db.sect4+, db.simplesect*) - | db.simplesect+), + ((db.all.blocks+, db.sect3.sections?) + | db.sect3.sections), db.navigation.components* } } # ====================================================================== +db.sect4.sections = (db.sect5+, db.simplesect*) | db.simplesect+ + [ db:refname [ "sect4" ] db:refpurpose [ "A subsection within a Sect3" ] @@ -146,16 +146,16 @@ div { element sect4 { db.sect4.attlist, db.sect4.info, - ((db.all.blocks+, (db.optional.refentry | (db.sect5*, db.simplesect*))) - | db.required.refentry - | (db.sect5+, db.simplesect*) - | db.simplesect+), + ((db.all.blocks+, db.sect4.sections?) + | db.sect4.sections), db.navigation.components* } } # ====================================================================== +db.sect5.sections = db.simplesect+ + [ db:refname [ "sect5" ] db:refpurpose [ "A subsection within a Sect4" ] @@ -179,9 +179,8 @@ div { element sect5 { db.sect5.attlist, db.sect5.info, - ((db.all.blocks+, (db.optional.refentry | db.simplesect*)) - | db.required.refentry - | db.simplesect+), + ((db.all.blocks+, db.sect5.sections?) + | db.sect5.sections), db.navigation.components* } } -- 2.40.0