teacup/schemas/bp.rnc
2021-12-15 11:29:23 +00:00

628 lines
19 KiB
Text

namespace xl = "http://www.w3.org/1999/xlink"
default namespace db = "http://docbook.org/ns/docbook"
# 2015-12-14: Redefined toc info to accommodate subtitle; added math.inlines to extensions.inline so can have inline eqns in para; allowed attributes on inline equation; allowed any value for footnote/@label so can take asterisk, dagger etc
# 2015-12-11: Tweaked content model of db.bibliomisc and db.bibliographic.elements
# 2015-07-08: Added 'default' as option on phrase/@role for untyped elements mapped from new Bloomsbury DocBook
# 2011-10-20: Added @legDivType = article | title to chapter and section to support EU Legislation
# 2011-10-09: Add @role=signpost to formalpara, which will work better for them than sections
# 2011-09-23: Added @role="other" to toc; and @role="signpost" to section
# 2011-09-15: Added regulation and decision as values of part[@legType] to model the EU legislation in VAT Acts
# 2011-08-16: Added @legDivType and @legDivValue to para for use in SIs, and loosened formalpara so title not required so can act as annotations wrapper in some circumstances
# 2011-05-12: toc can only contain para blocks and tocdiv; toc/info is optional
# 2011-05-03: Added smallcaps as an option for emphasis[@role]
# 2011-05-03: Changed relatedTitle to relatedURI as values of biblio @class, since that is what we're using
# 2011-04-22: Added xref2 and pnxref to permitted values of phrase[@role] to support final conversion and not lose location of unresolved links -- remove it once all links fixed
# 2011-04-21: removed @chunking from part and appendix. Stupid error putting it there in the first place
# 2011-04-19: Added new enumerated values on biblio @class to support generation of PubFactory metadata files
# 2011-04-18: Removed lastUpdated as value in date[@role], Made @role mandatory for revision and added new revisions typology
# 2011-04-07: New schedulePart, regulation and order values for @legDivType and now allow @chunking on part and chapterand appendix, and slightly loosened fruther tocdiv
# 2011-04-01: new legType on part, and legDivType and legDivValue attributes on part, chapter, section to support legislation GoTo
# 2011-03-29: new hearings and caserefs elements for cases and remodelled info
# 2011-03-24: citation notAllowed
# 2011-03-23: Added @role=case on chapter
# 2011-03-22: Added strictness to IDs and info/title for chunks
# 2011-03-10: Added @role=precedentChunk to section
include "docbook.rnc" {
# reduce common attributes
db.common.base.attributes =
db.xml.lang.attribute?
& db.version.attribute?
& db.xreflabel.attribute?
# enforce @xml:id in some places
db.book.attlist =
db.book.role.attribute
& db.xml.id.attribute
& db.common.base.attributes
& db.common.linking.attributes
& db.label.attribute?
& db.book.status.attribute?
db.book.role.attribute = attribute role { "commentary" | "legislation" | "cases" | "newsletter" | "precedents"}
db.chapter.role.attribute = attribute role { "case" }
db.acknowledgements.attlist =
db.xml.id.attribute
& db.common.linking.attributes
& db.label.attribute?
db.preface.attlist =
db.xml.id.attribute
& db.common.linking.attributes
& db.label.attribute?
db.dedication.attlist =
db.xml.id.attribute
& db.common.linking.attributes
& db.label.attribute?
db.glossary.attlist =
db.xml.id.attribute
& db.common.linking.attributes
& db.label.attribute?
db.appendix.attlist =
db.xml.id.attribute
& db.common.linking.attributes
& db.label.attribute?
db.part.attlist =
db.xml.id.attribute
& db.part.role.attribute?
& db.part.legType.attribute?
& db.part.legDivType.attribute?
& db.part.legDivValue.attribute?
& db.common.linking.attributes
& db.label.attribute?
db.chapter.attlist =
db.xml.id.attribute
& db.chapter.role.attribute?
& db.chapter.legDivType.attribute?
& db.chapter.legDivValue.attribute?
& db.chapter.chunking.attribute?
& db.common.linking.attributes
& db.label.attribute?
db.index.attlist =
db.xml.id.attribute
& db.common.linking.attributes
& db.label.attribute?
db.indexdiv.attlist =
db.xml.id.attribute
& db.common.linking.attributes
& db.label.attribute?
db.para.attlist =
db.para.role.attribute?
& db.para.legDivType.attribute?
& db.para.legDivValue.attribute?
& db.common.attributes
& db.common.linking.attributes
# enforce info/title at chunks
db.book.info = db._info.title.req
db.glossary.info = db._info.title.req
db.bibliography.info = db._info.title.req
db.index.info = db._info.title.req
# enumerated lists
db.section.role.attribute = attribute role { "bibl" | "annotations" | "headnote" | "notes" | "tableSect" | "schedule" | "precedent" | "precedentChunk" | "signpost"}
db.itemizedlist.role.attribute = attribute role { "simple" | "bulleted" }
db.itemizedlist.attlist =
db.itemizedlist.role.attribute
& db.common.attributes
& db.common.linking.attributes
& db.spacing.attribute?
db.emphasis.role.attribute = attribute role { "italic" | "bold" | "underline" | "roman" | "bi" | "smallcaps"}
db.emphasis.attlist =
db.emphasis.role.attribute
& db.common.attributes
& db.common.linking.attributes
db.partintro.role.attribute = attribute role { "longTitle" | "other" }
db.partintro.attlist =
db.partintro.role.attribute
& db.common.attributes
& db.common.linking.attributes
db.bibliolist.role.attribute = attribute role { "inline" | "block" }
db.bibliolist.attlist =
db.bibliolist.role.attribute
& db.common.attributes
& db.common.linking.attributes
db.title.role.attribute = attribute role { "journal" | "book" | "article" }
db.title.attlist =
db.title.role.attribute?
& db.title.alphasort.attribute?
& db.common.attributes
& db.common.linking.attributes
db.biblioset.role.attribute = attribute role { "publisher" | "isbns" | "productMetadata" }
# biblio types
db.biblio.class.enumeration =
## A document object identifier.
"doi"
|
## An international standard book number in old 10 digit form.
"isbn10"
|
## An international standard book number in new 13 digit form.
"isbn13"
|
## An international standard technical report number (ISO 10444).
"isrn"
|
## An international standard serial number.
"issn"
|
## A Library of Congress reference number.
"libraryofcongress"
|
## A publication number (an internal number or possibly organizational standard).
"pubsnumber"
|
## A Uniform Resource Identifier
"uri"
|
## PubFactory book identifier
"pfID"
|
## PubFactory collection ID
"collection"
|
## PubFactory related-uri
"relatedURI"
|
## PubFactory Jurisdiction
"jurisdiction"
# toc: enumerated list and made role mandatory
db.toc.role.attribute = attribute role { "cases" | "statutes" | "legislation" | "other" }
db.toc.attlist =
db.toc.role.attribute
& db.xml.id.attribute
& db.common.linking.attributes
& db.label.attribute?
# Useful to allow subtitles in ToC
db.toc.info = db._info.title.req
db.toc = element toc {
db.toc.attlist,
db.toc.info,
db.para.blocks*,
(db.tocdiv | db.tocentry)*
}
# change db._text to db.all.inlines
db.bibliomisc =
## Untyped bibliographic information
element bibliomisc { db.bibliomisc.attlist, (db.all.inlines)+ }
# add ubiq.inlines
db.bibliographic.elements =
db.info.elements
| db.publishing.inlines
| db.ubiq.inlines
| db.citerefentry
| db.citetitle
| db.citebiblioid
| db.person
| db.personblurb
| db.personname
| db.subtitle
| db.title
| db.titleabbrev
# 24.11.2010: Made role mandatory
db.phrase.role.attribute = attribute role { "singleUnderline" | "doubleUnderline" | "casename" | "caseref" | "indexTerm" | "indexRefs" | "implied" | "xref2" | "pnxref" | "default"}
db.phrase.attlist =
db.phrase.role.attribute
& db.common.attributes
& db.common.linking.attributes
db.phrase =
## A span of text
element phrase { db.phrase.attlist, db.all.inlines* }
# modified elements
# add db.pb (optional page break)
db.para.blocks = db.anchor | db.para | db.formalpara | db.simpara | db.pb
# add pb, case, statute, and cut some elements
db.publishing.inlines =
(db.abbrev
| db.acronym
| db.date
| db.emphasis
| db.footnote
| db.footnoteref
| db.foreignphrase
| db.pb
| db.phrase
| db.quote
| db.subscript
| db.superscript
| db.statute
| db.case)
| db.glossary.inlines
| db.coref
# need to allow asterisk as footnote ref values
db.footnote.label.attribute = attribute label { text }
# modified (added db.para) to better support othercredit in book-level metadata
db.credit.contentmodel =
db.para? & (db.person.author.contentmodel | db.org.author.contentmodel)
# Enumerated list for revision @role
db.revision.role.attribute = attribute role { "major" | "minor"}
# Make @role mandatory on revision
db.revision.attlist =
db.revision.role.attribute
& db.common.attributes
& db.common.linking.attributes
# modified date
# Enumerated value of @role, and add in new @value (declaration is later in the file)
db.date.role.attribute = attribute role { "lawStatedAt" | "published" | "accessed"}
db.date.attlist =
db.date.role.attribute?
& db.date.value.attribute?
& db.common.attributes
& db.common.linking.attributes
db.date =
## The date of publication or revision of a document
element date { db.date.attlist, text }
# modified abstract: extended content model to add lists
db.abstract =
## A summary
element abstract {
db.abstract.attlist, db.abstract.info, (db.para.blocks | db.list.blocks)+
}
# choices
db.table.choice = db.html.table
db.informaltable.choice = db.html.informaltable
# Math: loosened this up so can have mediaobject AND mathml
db.equation.content = (db.mediaobject | db.mathphrase | db._any.mml)+
# removed element groups
db.synopsis.blocks = notAllowed
db.technical.blocks = notAllowed
db.verbatim.blocks = notAllowed
db.domain.inlines = notAllowed
db.technical.inlines = notAllowed
db.product.inlines = notAllowed
db.error.inlines = notAllowed
db.programming.inlines = notAllowed
db.systemitem.inlines = notAllowed
db.gui.inlines = notAllowed
db.keyboard.inlines = notAllowed
db.verbatim.inlines = notAllowed
db.markup.inlines = notAllowed
db.userinput.inlines = notAllowed
db.oo.inlines = notAllowed
db.replaceable.inlines = notAllowed
# inlineequation
db.inlineequation.attlist = db.condition.attribute & db.common.attributes
# add an inline
db.extension.inlines = (db.userinput | db.math.inlines)*
db.userinput.role.attribute = attribute role { "blank" | "dots" }
db.userinput.attlist =
db.userinput.role.attribute
& db.userinput.length.attribute
& db.common.attributes
& db.common.linking.attributes
# removed elements
db.bridgehead = notAllowed
db.caution = notAllowed
db.important = notAllowed
db.sect1 = notAllowed
db.sect2 = notAllowed
db.sect3 = notAllowed
db.sect4 = notAllowed
db.sect5 = notAllowed
db.area = notAllowed
db.callout = notAllowed
db.prompt = notAllowed
db.envar = notAllowed
db.filename = notAllowed
db.command = notAllowed
db.computeroutput = notAllowed
db.citation = notAllowed
#AMENDING THE DB.KEYWORDS
db.keyword =
element keyword { db.keyword.attlist,
db.indexing.inlines?,
db.recursive.blocks.or.sections+,
(text)+ }
#AMENDING THE DB.FORMALPARA
db.formalpara.role.attribute = attribute role { "overview" | "example" | "annotations" | "precedent" | "precedentNotes" | "signpost"}
db.formalpara =
element formalpara {
db.formalpara.attlist,
db.formalpara.info?,
db.indexing.inlines*,
db.recursive.blocks.or.sections+
}
# amend part, loosened so part.components can come before partintro. Needed for legislation so can have toc before partintro, and allow nested parts, also allowed section for cases in extremis in appendices etc
db.part =
element part {
db.part.attlist, db.part.info, (db.part | db.partintro | db.part.components | db.section)+
}
db.part.role.attribute = attribute role { "legislation" }
# AMEND tocdiv
db.tocdiv.role.attribute = attribute role { text }
# remove db.tocdiv.pagenum.attribute = db.toc.pagenum.attribute
db.tocdiv.attlist =
db.tocdiv.role.attribute?
& db.common.attributes
# & db.tocdiv.pagenum.attribute?
& db.linkend.attribute?
db.tocdiv.info = db._info.title.req
db.tocdiv =
## A division in a table of contents
# loosen model since we want to use variablelist since it gives more structure than tocentry, and content is optional since some legislation ToCs just have the headings, esp for Schedules
element tocdiv {
db.tocdiv.attlist,
db.tocdiv.info?,
(db.all.blocks | db.tocdiv)*
}
# Amend section
# made info optional; assume will have title at level 1 but not required lower in tree; this is to accommodate the commentary notes etc in legislation and commentary. New chunking attribute to force chunking of child sections
db.section.attlist =
db.section.role.attribute?
& db.section.chunking.attribute?
& db.section.legDivType.attribute?
& db.section.legDivValue.attribute?
& db.common.attributes
& db.common.linking.attributes
& db.label.attribute?
& db.section.status.attribute?
db.section =
element section {
db.section.attlist,
db.section.info?,
db.recursive.blocks.or.sections,
db.navigation.components*}
# add label, court, judge to info
db.info.elements =
(db.abstract
| db.address
| db.artpagenums
| db.author
| db.authorgroup
| db.authorinitials
| db.bibliocoverage
| db.biblioid
| db.bibliosource
| db.caserefs
| db.collab
| db.confgroup
| db.contractsponsor
| db.contractnum
| db.copyright
| db.cover
| db.date
| db.edition
| db.editor
| db.hearing
| db.issuenum
| db.jurisdiction
| db.keywordset
| db.legalnotice
| db.mediaobject
| db.org
| db.orgname
| db.othercredit
| db.pagenums
| db.printhistory
| db.pubdate
| db.publisher
| db.publishername
| db.releaseinfo
| db.revhistory
| db.seriesvolnums
| db.subjectset
| db.volumenum
| db.label
| db.info.extension)
| db.annotation
| db.extendedlink
| (db.bibliomisc | db.bibliomset | db.bibliorelation | db.biblioset)
| db.itermset
| (db.productname | db.productnumber)
}
#END INCLUDE
#NEW STATUTE ELEMENT
db.statute =
element statute { db.statute.attlist, (db.general.inlines | (text)+)+ }
db.statute.role.attribute = attribute role { "option1" | "option2" }
db.statute.attlist =
db.statute.role.attribute?
& db.common.attributes
& db.common.linking.attributes
#NEW CASE ELEMENT
db.case =
element case { db.case.attlist, db.all.inlines*, (text)+ }
db.case.role.attribute = attribute role { "option1" | "option2" }
db.case.attlist =
db.case.role.attribute?
& db.common.attributes
& db.common.linking.attributes
#NEW HEARING ELEMENT
db.hearing =
element hearing { db.hearing.attlist, (db.court | db.date | db.judge )+ }
db.hearing.attlist =
db.common.attributes
& db.common.linking.attributes
#NEW COURT ELEMENT
db.court =
element court { db.court.attlist, db.all.inlines*, (text)+ }
db.court.role.attribute = attribute role { "Ireland" | "UK" | "EU" }
db.court.attlist =
db.court.role.attribute?
& db.common.attributes
& db.common.linking.attributes
#NEW CASEREFS ELEMENT
db.caserefs =
element caserefs { db.caserefs.attlist, (db.phrase | (text))+ }
db.caserefs.attlist =
db.common.attributes
& db.common.linking.attributes
#NEW JUDGE ELEMENT
db.judge =
element judge { db.judge.attlist, db.all.inlines?, db._text, (text)+ }
db.judge.attlist =
db.common.attributes
& db.common.linking.attributes
#NEW JURISDICTION ELEMENT
db.jurisdiction =
element jurisdiction { db.jurisdiction.attlist, db.all.inlines?, db._text, (text)+ }
db.jurisdiction.value.attribute = attribute value { (text) }
db.jurisdiction.attlist =
db.jurisdiction.value.attribute
#NEW PAGE BREAK ELEMENT
db.pb.value.attribute = attribute value { text }
db.pb.attlist =
db.pb.value.attribute
db.pb =
## A page break in the original printed document; not necessarily to be used as a formatting instruction
element pb { db.pb.attlist, empty }
# NEW VALUE ATTRIBUTE ON DATE
db.date.value.attribute = attribute value { xsd:date }
# New attribute on userinput
db.userinput.length.attribute = attribute length { text }
# New attribute on chapter, section
db.chapter.chunking.attribute = attribute chunking { "children" | "selfOnly" | "none"}
db.section.chunking.attribute = attribute chunking { "children" | "selfOnly" | "none"}
# New attribute on title
db.title.alphasort.attribute = attribute alphasort { text }
# New attributes to support legislation GoTo
db.part.legType.attribute = attribute legType { "statute" | "SI" | "order" | "directive" | "leaflet" | "regulation" | "decision"}
db.part.legDivType.attribute = attribute legDivType { "part" | "chapter" | "section" | "schedule"}
db.part.legDivValue.attribute = attribute legDivValue { text }
db.chapter.legDivType.attribute = attribute legDivType { "part" | "chapter" | "section" | "schedule" | "para" | "schedulePart" | "regulation" | "order" | "title" | "article"}
db.chapter.legDivValue.attribute = attribute legDivValue { text }
db.section.legDivType.attribute = attribute legDivType { "part" | "chapter" | "section" | "schedule" | "para" | "schedulePart" | "regulation" | "order" | "title" | "article"}
db.section.legDivValue.attribute = attribute legDivValue { text }
db.para.legDivType.attribute = attribute legDivType { "section" | "para" | "schedulePart"}
db.para.legDivValue.attribute = attribute legDivValue { text }