From 3120f36217af82f3eb1ec35548b09073792ef33a Mon Sep 17 00:00:00 2001 From: Norman Walsh Date: Tue, 6 Jan 2004 13:54:31 +0000 Subject: [PATCH] Snapshot; about to replace with significantly reworked modules --- docbook/relaxng/src/bibliography.rnc | 59 ++++++++ docbook/relaxng/src/callouts.rnc | 3 + docbook/relaxng/src/calstbl.rnc | 4 +- docbook/relaxng/src/docbook.rnc | 6 +- docbook/relaxng/src/glossary.rnc | 108 +++++++++++++++ docbook/relaxng/src/hier.rnc | 96 +------------ docbook/relaxng/src/index.rnc | 131 ++++++++++++++++++ docbook/relaxng/src/pool.rnc | 197 +++------------------------ docbook/relaxng/src/refentry.rnc | 2 + docbook/relaxng/src/toc.rnc | 28 ++++ 10 files changed, 360 insertions(+), 274 deletions(-) create mode 100644 docbook/relaxng/src/bibliography.rnc create mode 100644 docbook/relaxng/src/glossary.rnc create mode 100644 docbook/relaxng/src/index.rnc create mode 100644 docbook/relaxng/src/toc.rnc diff --git a/docbook/relaxng/src/bibliography.rnc b/docbook/relaxng/src/bibliography.rnc new file mode 100644 index 000000000..8606c6cac --- /dev/null +++ b/docbook/relaxng/src/bibliography.rnc @@ -0,0 +1,59 @@ +# This file is part of DocBook NG: The "Absinthe" Release. + +# This schema is a "work-in-progress". It validates a DocBook-like grammar that +# may, in some incarnation, form the basis for DocBook V.next. Or it may not. +# At the moment, it's just an exploration by Norm. It has utterly no normative +# value at all. +# +# Author: Norman Walsh, +# Source: Derived from DocBook XML V4.3 +# Release: $Id$ +# + +navigation.components |= db.bibliography +list.blocks |= db.bibliolist + +info.elements |= db.bibliomisc | db.bibliomset | db.bibliorelation | db.biblioset + +relation.attribute = attribute relation { text }? + +db.biblioentry = element biblioentry { bibliographic.elements+ } + +db.bibliomixed = element bibliomixed { (text | bibliographic.elements)* } + +biblioset.relation.attrib = relation.attribute +db.biblioset = element biblioset { bibliographic.elements+ } + +bibliomset.relation.attrib = relation.attribute +db.bibliomset = element bibliomset { (docbook.text | bibliographic.elements)* } + +db.bibliomisc = element bibliomisc { docbook.text } + +bibliography.status.attrib = status.attribute? +bibliography.label.attrib = label.attribute? +bibliography.info = docbook.info +db.bibliography = + element bibliography { + bibliography.info, + blocks*, + (db.bibliodiv+ | (db.biblioentry | db.bibliomixed)+) + } + +bibliodiv.status.attrib = status.attribute? +bibliodiv.label.attrib = label.attribute? +bibliodiv.info = docbook.info.titlereq +db.bibliodiv = + element bibliodiv { + bibliodiv.info, + blocks*, + (db.biblioentry | db.bibliomixed)+ + } + +bibliolist.info = docbook.info.titleonly +db.bibliolist = + element bibliolist { + bibliolist.info?, + blocks*, + (db.biblioentry | db.bibliomixed)+ + } + diff --git a/docbook/relaxng/src/callouts.rnc b/docbook/relaxng/src/callouts.rnc index e19b1b0bb..7fbf74217 100644 --- a/docbook/relaxng/src/callouts.rnc +++ b/docbook/relaxng/src/callouts.rnc @@ -23,6 +23,9 @@ computeroutput.inlines |= db.co verbatim.inlines |= db.co prompt.inlines |= db.co systemitem.inlines |= db.co +computeroutput.inlines |= db.co +userinput.inlines |= db.co +replaceable.inlines |= db.co area.units.enumtype.attribute = attribute units { diff --git a/docbook/relaxng/src/calstbl.rnc b/docbook/relaxng/src/calstbl.rnc index 153eaef27..0cf6386a9 100644 --- a/docbook/relaxng/src/calstbl.rnc +++ b/docbook/relaxng/src/calstbl.rnc @@ -113,14 +113,14 @@ cals.table.pgwide.attrib = attribute pgwide { "0" | "1" }? cals.table.info = docbook.info.titleonlyreq cals.table = element table { cals.table.info, - db.indexterm*, + indexing.inlines*, db.textobject*, (db.mediaobject+|db.tgroup+) } cals.informaltable.info = docbook.info.titleforbidden cals.informaltable = element informaltable { cals.informaltable.info, - db.indexterm*, + indexing.inlines*, db.textobject*, (db.mediaobject+|db.tgroup+) } diff --git a/docbook/relaxng/src/docbook.rnc b/docbook/relaxng/src/docbook.rnc index 9efa376ad..d2e2f4587 100644 --- a/docbook/relaxng/src/docbook.rnc +++ b/docbook/relaxng/src/docbook.rnc @@ -14,18 +14,20 @@ namespace ctrl = "http://nwalsh.com/xmlns/schema-control/" start = db.set - | db.setindex | db.book | divisions | components | navigation.components - | db.refentry | db.section | db.para include "hier.rnc" include "refentry.rnc" include "pool.rnc" +include "glossary.rnc" +include "bibliography.rnc" +include "index.rnc" +include "toc.rnc" include "tasks.rnc" include "callouts.rnc" include "ebnf.rnc" diff --git a/docbook/relaxng/src/glossary.rnc b/docbook/relaxng/src/glossary.rnc new file mode 100644 index 000000000..142a580c8 --- /dev/null +++ b/docbook/relaxng/src/glossary.rnc @@ -0,0 +1,108 @@ +# This file is part of DocBook NG: The "Absinthe" Release. + +# This schema is a "work-in-progress". It validates a DocBook-like grammar that +# may, in some incarnation, form the basis for DocBook V.next. Or it may not. +# At the moment, it's just an exploration by Norm. It has utterly no normative +# value at all. +# +# Author: Norman Walsh, +# Source: Derived from DocBook XML V4.3 +# Release: $Id$ +# + +namespace s = "http://www.ascc.net/xml/schematron" + +general.inlines |= glossary.inlines +list.blocks |= db.glosslist +navigation.components |= db.glossary + +glossary.inlines = + db.firstterm + | db.glossterm + +glosslist.info = docbook.info.titleonly +db.glosslist = element glosslist { glosslist.info?, blocks*, db.glossentry+ } + +glossentry.sortas.attrib = attribute sortas { text }? +db.glossentry = + element glossentry { + db.glossterm, + db.acronym?, + db.abbrev?, + db.indexterm*, + (db.glosssee | db.glossdef+) + } + +glossdef.subject.attrib = attribute subject { text }? +db.glossdef = element glossdef { blocks+, db.glossseealso* } + +glosssee.otherterm.attrib = attribute otherterm { xsd:IDREF }? +db.glosssee = + [ + s:rule [ + context = "glosssee[@linkend]" + s:assert [ + test = "name(//*[@id=current()/@linkend]) = 'glossentry'" + "@linkend on glosssee must point to a glossentry." + ] + ] + ] + element glosssee { inlines* } + +glossseealso.otherterm.attrib = attribute otherterm { xsd:IDREF }? +db.glossseealso = + [ + s:rule [ + context = "glossseealso[@linkend]" + s:assert [ + test = "name(//*[@id=current()/@linkend]) = 'glossentry'" + "@linkend on glossseealso must point to a glossentry." + ] + ] + ] + element glossseealso { inlines* } + +firstterm.baseform.attrib = glossterm.baseform.attrib +db.firstterm = + [ + s:rule [ + context = "firstterm[@linkend]" + s:assert [ + test = "name(//*[@id=current()/@linkend]) = 'glossentry'" + "@linkend on firstterm must point to a glossentry." + ] + ] + ] + element firstterm { inlines* } + +glossterm.baseform.attrib = attribute baseform { text }? + +db.glossterm = + [ + s:rule [ + context = "glossterm[@linkend]" + s:assert [ + test = "name(//*[@id=current()/@linkend]) = 'glossentry'" + "@linkend on glossterm must point to a glossentry." + ] + ] + ] + element glossterm { inlines* } + +glossary.status.attrib = status.attribute? +glossary.label.attrib = label.attribute? +glossary.info = docbook.info +db.glossary = + element glossary { + glossary.info, + blocks*, + (db.glossdiv+ | db.glossentry+), + db.bibliography? + } + +glossdiv.status.attrib = status.attribute? +glossdiv.label.attrib = label.attribute? +glossdiv.info = docbook.info.titlereq +db.glossdiv = + element glossdiv { glossdiv.info, blocks*, db.glossentry+ } + diff --git a/docbook/relaxng/src/hier.rnc b/docbook/relaxng/src/hier.rnc index 13bb21f26..dc3e28056 100644 --- a/docbook/relaxng/src/hier.rnc +++ b/docbook/relaxng/src/hier.rnc @@ -26,18 +26,20 @@ components = | db.article | db.colophon -navigation.components = - db.toc | db.index | db.glossary | db.bibliography +navigation.components = notAllowed component.contentmodel = navigation.components*, blocks.or.sections, navigation.components* # ====================================================================== +setindex.components = notAllowed +toc.components = notAllowed + set.status.attrib = status.attribute? set.label.attrib = label.attribute? set.info = docbook.info.titlereq -db.set = element set { set.info, db.toc?, (db.set|db.book)+, db.setindex? } +db.set = element set { set.info, toc.components?, (db.set|db.book)+, setindex.components? } book.status.attrib = status.attribute? book.label.attrib = label.attribute? @@ -57,19 +59,6 @@ colophon.info = docbook.info db.colophon = element colophon { colophon.info, blocks+ } -toc.info = docbook.info.titleonly -db.toc = element toc { toc.info, blocks*, (db.tocdiv | db.tocentry)* } - -tocdiv.pagenum.attrib = pagenum.attribute? -tocdiv.linkend.attrib = linkend.attribute? - -tocdiv.info = docbook.info -db.tocdiv = element tocdiv { tocdiv.info, blocks*, (db.tocdiv | db.tocentry)+ } - -tocentry.pagenum.attrib = pagenum.attribute? -tocentry.linkend.attrib = linkend.attribute? -db.tocentry = element tocentry { inlines* } - appendix.status.attrib = status.attribute? appendix.label.attrib = label.attribute? appendix.info = docbook.info.titlereq @@ -126,81 +115,6 @@ simplesect.info = docbook.info.titlereq db.simplesect = element simplesect { simplesect.info, blocks+ } -bibliography.status.attrib = status.attribute? -bibliography.label.attrib = label.attribute? -bibliography.info = docbook.info -db.bibliography = - element bibliography { - bibliography.info, - blocks*, - (db.bibliodiv+ | (db.biblioentry | db.bibliomixed)+) - } - -bibliodiv.status.attrib = status.attribute? -bibliodiv.label.attrib = label.attribute? -bibliodiv.info = docbook.info.titlereq -db.bibliodiv = - element bibliodiv { - bibliodiv.info, - blocks*, - (db.biblioentry | db.bibliomixed)+ - } - -glossary.status.attrib = status.attribute? -glossary.label.attrib = label.attribute? -glossary.info = docbook.info -db.glossary = - element glossary { - glossary.info, - blocks*, - (db.glossdiv+ | db.glossentry+), - db.bibliography? - } - -glossdiv.status.attrib = status.attribute? -glossdiv.label.attrib = label.attribute? -glossdiv.info = docbook.info.titlereq -db.glossdiv = - element glossdiv { glossdiv.info, blocks*, db.glossentry+ } - -index.info = docbook.info -db.index = - element index { - index.info, - blocks*, - (db.indexdiv* | db.indexentry* | db.segmentedlist) - } - -setindex.info = docbook.info -db.setindex = - element setindex { setindex.info, blocks*, (db.indexdiv* | db.indexentry*) } - -indexdiv.info = docbook.info.titlereq -db.indexdiv = - element indexdiv { indexdiv.info, blocks*, (db.indexentry+|db.segmentedlist) } - -db.indexentry = - element indexentry { - db.primaryie, - (db.seeie | db.seealsoie)*, - (db.secondaryie, (db.seeie | db.seealsoie | db.tertiaryie)*)* - } - -primaryie.linkends.attrib = linkends.attribute? -db.primaryie = element primaryie { inlines* } - -secondaryie.linkends.attrib = linkends.attribute? -db.secondaryie = element secondaryie { inlines* } - -tertiaryie.linkends.attrib = linkends.attribute? -db.tertiaryie = element tertiaryie { inlines* } - -seeie.linkend.attrib = linkend.attribute? -db.seeie = element seeie { inlines* } - -seealsoie.linkends.attrib = linkends.attribute? -db.seealsoie = element seealsoie { inlines* } - db.ackno = element ackno { para.blocks+ } article.components.optional = db.section* | db.simplesect* diff --git a/docbook/relaxng/src/index.rnc b/docbook/relaxng/src/index.rnc new file mode 100644 index 000000000..7343b2e0f --- /dev/null +++ b/docbook/relaxng/src/index.rnc @@ -0,0 +1,131 @@ +# This file is part of DocBook NG: The "Absinthe" Release. + +# This schema is a "work-in-progress". It validates a DocBook-like grammar that +# may, in some incarnation, form the basis for DocBook V.next. Or it may not. +# At the moment, it's just an exploration by Norm. It has utterly no normative +# value at all. +# +# Author: Norman Walsh, +# Source: Derived from DocBook XML V4.3 +# Release: $Id$ +# + +start |= db.setindex + +ubiq.inlines |= db.indexterm +indexing.inlines |= db.indexterm +blocks.nopara |= db.indexterm +navigation.components |= db.index +setindex.components = db.setindex + +info.elements |= db.itermset + +significance.attribute = attribute significance { "normal" | "preferred" } +zone.attribute = attribute zone { xsd:IDREFS } +pagenum.attribute = attribute pagenum { text } +scope.attribute = attribute scope { "all" | "global" | "local" } + +db.itermset = element itermset { indexterm.singular+ } + +indexterm.singular.significance.attrib = significance.attribute? +indexterm.startofrange.significance.attrib = significance.attribute? +indexterm.endofrange.significance.attrib = significance.attribute? + +indexterm.singular.zone.attrib = zone.attribute? +indexterm.startofrange.zone.attrib = zone.attribute? +indexterm.endofrange.zone.attrib = zone.attribute? + +indexterm.singular.pagenum.attrib = pagenum.attribute? +indexterm.startofrange.pagenum.attrib = pagenum.attribute? +indexterm.endofrange.pagenum.attrib = pagenum.attribute? + +indexterm.singular.scope.attrib = scope.attribute? +indexterm.startofrange.scope.attrib = scope.attribute? +indexterm.endofrange.scope.attrib = scope.attribute? + +indexterm.singular.class.attrib = attribute class { "singular" }? +indexterm.startofrange.class.attrib = attribute class { "startofrange" } +indexterm.endofrange.class.attrib = attribute class { "endofrange" } + +indexterm.endofrange.startref.attrib = attribute startref { xsd:IDREF } + +indexterm.contentmodel = + db.primary?, + ((db.secondary, + ((db.tertiary, (db.see | db.seealso+)?) + | db.see + | db.seealso+)?) + | db.see + | db.seealso+)? + +indexterm.singular = + element indexterm { + indexterm.contentmodel + } + +indexterm.startofrange = + element indexterm { + indexterm.contentmodel + } + +indexterm.endofrange = + element indexterm { + indexterm.contentmodel + } + +db.indexterm = (indexterm.singular|indexterm.startofrange|indexterm.endofrange) + +sortas.attribute = attribute sortas { text }? + +primary.sortas.attrib = sortas.attribute? +db.primary = element primary { inlines* } + +secondary.sortas.attrib = sortas.attribute? +db.secondary = element secondary { inlines* } + +tertiary.sortas.attrib = sortas.attribute? +db.tertiary = element tertiary { inlines* } + +db.see = element see { inlines* } + +db.seealso = element seealso { inlines* } + +index.info = docbook.info +db.index = + element index { + index.info, + blocks*, + (db.indexdiv* | db.indexentry* | db.segmentedlist) + } + +setindex.info = docbook.info +db.setindex = + element setindex { setindex.info, blocks*, (db.indexdiv* | db.indexentry*) } + +indexdiv.info = docbook.info.titlereq +db.indexdiv = + element indexdiv { indexdiv.info, blocks*, (db.indexentry+|db.segmentedlist) } + +db.indexentry = + element indexentry { + db.primaryie, + (db.seeie | db.seealsoie)*, + (db.secondaryie, (db.seeie | db.seealsoie | db.tertiaryie)*)* + } + +primaryie.linkends.attrib = linkends.attribute? +db.primaryie = element primaryie { inlines* } + +secondaryie.linkends.attrib = linkends.attribute? +db.secondaryie = element secondaryie { inlines* } + +tertiaryie.linkends.attrib = linkends.attribute? +db.tertiaryie = element tertiaryie { inlines* } + +seeie.linkend.attrib = linkend.attribute? +db.seeie = element seeie { inlines* } + +seealsoie.linkends.attrib = linkends.attribute? +db.seealsoie = element seealsoie { inlines* } + + diff --git a/docbook/relaxng/src/pool.rnc b/docbook/relaxng/src/pool.rnc index a029f5903..4727716d6 100644 --- a/docbook/relaxng/src/pool.rnc +++ b/docbook/relaxng/src/pool.rnc @@ -132,8 +132,6 @@ common.linking.attributes = # ====================================================================== -relation.attribute = attribute relation { text }? - linenumbering.attribute = attribute linenumbering { "numbered" | "unnumbered" } startinglinenumber.attribute = attribute startinglinenumber { xsd:integer } verb-language.attribute = attribute language { text } @@ -176,14 +174,9 @@ biblio.class-other.attributes = biblio.class.attrib = (biblio.class-enum.attribute | biblio.class-other.attributes) -significance.attribute = attribute significance { "normal" | "preferred" } -zone.attribute = attribute zone { xsd:IDREFS } -pagenum.attribute = attribute pagenum { text } -scope.attribute = attribute scope { "all" | "global" | "local" } - # ====================================================================== -ubiq.inlines = db.inlinemediaobject | db.anchor | db.indexterm | db.remark +ubiq.inlines = db.inlinemediaobject | db.anchor | db.remark text.phrase = element phrase { docbook.text } @@ -197,7 +190,6 @@ general.inlines = publishing.inlines | product.inlines | bibliography.inlines - | glossary.inlines | graphic.inlines | indexing.inlines | link.inlines @@ -279,12 +271,6 @@ bibliography.inlines = | db.orgname | db.editor -# TEI: no class - -glossary.inlines = - db.firstterm - | db.glossterm - # TEI: hqPhrase publishing.inlines = @@ -310,7 +296,7 @@ graphic.inlines = db.inlinemediaobject # TEI: metadata -indexing.inlines = db.indexterm +indexing.inlines = notAllowed # TEI: @@ -351,10 +337,10 @@ blocks.nopara = | technical.blocks | verbatim.blocks | synopsis.blocks - | db.indexterm | db.bridgehead | db.remark | db.revhistory + | db.highlights blocks = blocks.nopara @@ -397,7 +383,6 @@ list.blocks = | db.simplelist | db.variablelist | db.qandaset - | db.glosslist | db.segmentedlist verbatim.blocks = @@ -432,23 +417,19 @@ docbook.titleonlyreq = db.title & db.titleabbrev? info.elements = db.biblioid + | db.bibliosource | db.artpagenums | db.copyright | db.subjectset | db.keywordset | db.subjectset | db.keywordset - | db.itermset | db.abstract | db.authorgroup | db.author | db.editor | db.othercredit | db.bibliocoverage - | db.bibliomisc - | db.bibliomset - | db.bibliorelation - | db.biblioset | db.collab | db.confgroup | db.date @@ -481,10 +462,6 @@ bibliographic.elements = | db.productnumber | db.publishername -db.biblioentry = element biblioentry { bibliographic.elements+ } - -db.bibliomixed = element bibliomixed { (text | bibliographic.elements)* } - db.info = element info { docbook.title, info.elements* } db.info.titlereq = element info { docbook.titlereq, info.elements* } db.info.titleonly = element info { docbook.titleonly, info.elements* } @@ -556,14 +533,6 @@ ctrl:alternate-define [ ] ] -biblioset.relation.attrib = relation.attribute -db.biblioset = element biblioset { bibliographic.elements+ } - -bibliomset.relation.attrib = relation.attribute -db.bibliomset = element bibliomset { (docbook.text | bibliographic.elements)* } - -db.bibliomisc = element bibliomisc { docbook.text } - subjectset.scheme.attrib = attribute scheme { xsd:NMTOKEN }? db.subjectset = element subjectset { db.subject+ } @@ -576,8 +545,6 @@ db.keywordset = element keywordset { db.keyword+ } db.keyword = element keyword { text } -db.itermset = element itermset { indexterm.singular+ } - qandaset.defaultlabel.attrib = attribute defaultlabel { "none" | "number" | "qanda" }? qandaset.info = docbook.info.titleonly db.qandaset = @@ -665,7 +632,7 @@ ctrl:exclude [ from="db.footnote" exclude="db.footnote" ] db.footnote = element footnote { blocks+ } db.highlights = element highlights { - (list.blocks | admonition.blocks | para.blocks | db.indexterm)+ + (list.blocks | admonition.blocks | para.blocks | indexing.inlines)+ } para.blocks = @@ -675,7 +642,7 @@ para.blocks = | db.simpara formalpara.info = docbook.info.titleonlyreq -db.formalpara = element formalpara { formalpara.info, db.indexterm*, db.para } +db.formalpara = element formalpara { formalpara.info, indexing.inlines*, db.para } para.info = docbook.info.titleforbidden db.para = element para { para.info, (inlines | blocks.nopara)* } @@ -698,48 +665,6 @@ db.tip = element tip { admonition.contentmodel } db.warning = element warning { admonition.contentmodel } -glosslist.info = docbook.info.titleonly -db.glosslist = element glosslist { glosslist.info?, blocks*, db.glossentry+ } - -glossentry.sortas.attrib = sortas.attribute? -db.glossentry = - element glossentry { - db.glossterm, - db.acronym?, - db.abbrev?, - db.indexterm*, - (db.glosssee | db.glossdef+) - } - -glossdef.subject.attrib = attribute subject { text }? -db.glossdef = element glossdef { blocks+, db.glossseealso* } - -glosssee.otherterm.attrib = attribute otherterm { xsd:IDREF }? -db.glosssee = - [ - s:rule [ - context = "glosssee[@linkend]" - s:assert [ - test = "name(//*[@id=current()/@linkend]) = 'glossentry'" - "@linkend on glosssee must point to a glossentry." - ] - ] - ] - element glosssee { inlines* } - -glossseealso.otherterm.attrib = attribute otherterm { xsd:IDREF }? -db.glossseealso = - [ - s:rule [ - context = "glossseealso[@linkend]" - s:assert [ - test = "name(//*[@id=current()/@linkend]) = 'glossentry'" - "@linkend on glossseealso must point to a glossentry." - ] - ] - ] - element glossseealso { inlines* } - itemizedlist.mark.attrib = attribute mark { text }? itemizedlist.spacing.attrib = attribute spacing { "compact" | "normal" }? @@ -881,7 +806,7 @@ videodata.valign.attrib = attribute valign { "bottom" | "middle" | "top" }? videodata.width.attrib = attribute width { text }? videodata.contentwidth.attrib = attribute contentwidth { text }? videodata.scalefit.attrib = attribute scalefit { "0" | "1" }? -vidoedata.scale.attrib = attribute scale { text }? +videodata.scale.attrib = attribute scale { text }? videodata.depth.attrib = attribute depth { text }? videodata.contentdepth.attrib = attribute contentdepth { text }? @@ -912,7 +837,7 @@ textdata.encoding.attrib = attribute encoding { text }? textdata.info = docbook.info.titleforbidden db.textdata = element textdata { textdata.info } -db.caption = element caption { blocks+ } +# db.caption = element caption { blocks+ } equation.content = db.mediaobject @@ -1222,9 +1147,9 @@ db.confnum = element confnum { docbook.text } db.confsponsor = element confsponsor { docbook.text } -db.contractnum = element contractnum { docbook.text } +# db.contractnum = element contractnum { docbook.text } -db.contractsponsor = element contractsponsor { docbook.text } +# db.contractsponsor = element contractsponsor { docbook.text } db.copyright = element copyright { db.year+, db.holder* } @@ -1391,7 +1316,7 @@ db.classname = element classname { docbook.text } db.command = element command { inlines* } -computeroutput.inlines = (inlines|db.co) +computeroutput.inlines = (inlines) db.computeroutput = element computeroutput { computeroutput.inlines* } @@ -1549,13 +1474,15 @@ db.optional = element optional { inlines* } parameter.class.attrib = attribute class { "command" | "function" | "option" }? db.parameter = element parameter { docbook.text } -prompt.inlines = (docbook.text|db.co) +prompt.inlines = (docbook.text) db.prompt = element prompt { prompt.inlines* } +replaceable.inlines = (docbook.text) + replaceable.class.attrib = attribute class { "command" | "function" | "option" | "parameter" }? -db.replaceable = element replaceable { (docbook.text|db.co)* } +db.replaceable = element replaceable { replaceable.inlines* } db.returnvalue = element returnvalue { docbook.text } @@ -1603,7 +1530,7 @@ systemitem.class.attrib = | "username" }? -systemitem.inlines = (docbook.text|db.co) +systemitem.inlines = (docbook.text) db.systemitem = element systemitem { systemitem.inlines* } @@ -1614,7 +1541,8 @@ db.token = element token { docbook.text } db.type = element type { docbook.text } -db.userinput = element userinput { (inlines|db.co)* } +userinput.inlines = inlines +db.userinput = element userinput { userinput.inlines* } db.abbrev = element abbrev { (docbook.text @@ -1662,35 +1590,8 @@ db.citetitle = element citetitle { inlines* } db.emphasis = element emphasis { inlines* } -firstterm.baseform.attrib = glossterm.baseform.attrib -db.firstterm = - [ - s:rule [ - context = "firstterm[@linkend]" - s:assert [ - test = "name(//*[@id=current()/@linkend]) = 'glossentry'" - "@linkend on firstterm must point to a glossentry." - ] - ] - ] - element firstterm { inlines* } - db.foreignphrase = element foreignphrase { inlines* } -glossterm.baseform.attrib = attribute baseform { text }? - -db.glossterm = - [ - s:rule [ - context = "glossterm[@linkend]" - s:assert [ - test = "name(//*[@id=current()/@linkend]) = 'glossentry'" - "@linkend on glossterm must point to a glossentry." - ] - ] - ] - element glossterm { inlines* } - db.phrase = element phrase { inlines* } db.quote = element quote { inlines* } @@ -1733,65 +1634,3 @@ ctrl:common-attributes [ element="anchor" attributes="common.attrib.idreq" ] db.anchor = element anchor { empty } -indexterm.singular.significance.attrib = significance.attribute? -indexterm.startofrange.significance.attrib = significance.attribute? -indexterm.endofrange.significance.attrib = significance.attribute? - -indexterm.singular.zone.attrib = zone.attribute? -indexterm.startofrange.zone.attrib = zone.attribute? -indexterm.endofrange.zone.attrib = zone.attribute? - -indexterm.singular.pagenum.attrib = pagenum.attribute? -indexterm.startofrange.pagenum.attrib = pagenum.attribute? -indexterm.endofrange.pagenum.attrib = pagenum.attribute? - -indexterm.singular.scope.attrib = scope.attribute? -indexterm.startofrange.scope.attrib = scope.attribute? -indexterm.endofrange.scope.attrib = scope.attribute? - -indexterm.singular.class.attrib = attribute class { "singular" }? -indexterm.startofrange.class.attrib = attribute class { "startofrange" } -indexterm.endofrange.class.attrib = attribute class { "endofrange" } - -indexterm.endofrange.startref.attrib = attribute startref { xsd:IDREF } - -indexterm.contentmodel = - db.primary?, - ((db.secondary, - ((db.tertiary, (db.see | db.seealso+)?) - | db.see - | db.seealso+)?) - | db.see - | db.seealso+)? - -indexterm.singular = - element indexterm { - indexterm.contentmodel - } - -indexterm.startofrange = - element indexterm { - indexterm.contentmodel - } - -indexterm.endofrange = - element indexterm { - indexterm.contentmodel - } - -db.indexterm = (indexterm.singular|indexterm.startofrange|indexterm.endofrange) - -sortas.attribute = attribute sortas { text }? - -primary.sortas.attrib = sortas.attribute? -db.primary = element primary { inlines* } - -secondary.sortas.attrib = sortas.attribute? -db.secondary = element secondary { inlines* } - -tertiary.sortas.attrib = sortas.attribute? -db.tertiary = element tertiary { inlines* } - -db.see = element see { inlines* } - -db.seealso = element seealso { inlines* } diff --git a/docbook/relaxng/src/refentry.rnc b/docbook/relaxng/src/refentry.rnc index 6a2aaa2a3..26518ed63 100644 --- a/docbook/relaxng/src/refentry.rnc +++ b/docbook/relaxng/src/refentry.rnc @@ -11,6 +11,8 @@ # # ====================================================================== +start |= db.refentry + divisions |= db.reference part.components |= db.refentry | db.reference diff --git a/docbook/relaxng/src/toc.rnc b/docbook/relaxng/src/toc.rnc new file mode 100644 index 000000000..f0502cb39 --- /dev/null +++ b/docbook/relaxng/src/toc.rnc @@ -0,0 +1,28 @@ +# This file is part of DocBook NG: The "Absinthe" Release. + +# This schema is a "work-in-progress". It validates a DocBook-like grammar that +# may, in some incarnation, form the basis for DocBook V.next. Or it may not. +# At the moment, it's just an exploration by Norm. It has utterly no normative +# value at all. +# +# Author: Norman Walsh, +# Source: Derived from DocBook XML V4.3 +# Release: $Id$ +# + +navigation.components |= db.toc +toc.components |= db.toc + +toc.info = docbook.info.titleonly +db.toc = element toc { toc.info, blocks*, (db.tocdiv | db.tocentry)* } + +tocdiv.pagenum.attrib = attribute pagenum { text } +tocdiv.linkend.attrib = linkend.attribute? + +tocdiv.info = docbook.info +db.tocdiv = element tocdiv { tocdiv.info, blocks*, (db.tocdiv | db.tocentry)+ } + +tocentry.pagenum.attrib = pagenum.attribute? +tocentry.linkend.attrib = linkend.attribute? +db.tocentry = element tocentry { inlines* } + -- 2.49.0