Schema generation

From Digital Scholarship Group
Revision as of 14:33, 10 September 2020 by Sbauman (talk | contribs) (ODD documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Generating Schemas (and Documentation) from ODD

The ODD itself

The source customization ODD file for the wwp-store encoding language is in our textbase Subversion repository in textbase/schema/wwp-store.odd. It should be valid against the current or the development version of tei_odds. It should almost be valid against either the current or the development version of tei_customization. (There are a few “errors”, as that schema is designed to help write the ODD, not validate it.) In all 4 of those cases it should also be valid against the associated Schematron rules.

The edition number is stored on /TEI/teiHeader/fileDesc/editionStmt/edition/@n in major.minor.fix format. Any change to the ODD that represents a deliberate change to the set of documents validated by the schema ups the minor version number. Changes to only prose or class names or such may be reflected in only the fix number. The major number is reserved for overhauls or other very significant changes. (The last one, e.g., was the change from the TEI ODD language to the TEI PureODD language — i.e., purging (most of) the RELAX NG from the ODD.) The edition number is usually also reflected on the @n of the <change> element describing the change that brings the ODD up to the specified version.

The Subversion $Id:$ is also stored as the content of that <edition. In general it should not be updated by hand, but rather by Subversion on check-in. (This requires that the svn:keywords property be set, which it is.)

Currently the <schemaSpec> element is stored in <body>; someday soon I would like to move it to <back>, reserving the body for prose discussion.

The ODD file is loosely divided into “sections” delimited by nothing other than box comments. A list of those sections follows, in the order they currently occur in the ODD file. (But since the order of the specification children of <schemaSpec> is not constrained by TEI and is insignificant to an ODD processor, it may have changed in the ODD with no effect.)

element & module inclusion, and element deletion section
<moduleRef>s with @include or @except. If we had any schemaSpec/elementRef elements they would probably be here, too.
ODD/Schematron hack section
section for top-level <constraintSpec>s. In looking at this now, it should either be re-named or divided into two sections (and renamed).
element renaming section
set of <elementSpec> elements for cases in which the primary change being made is to change the name of the element. Often other changes are made, as well, but they are usually “minor” changes. E.g., the <titlePage> element is changed to the <titleBlock> element here, but also has a controlled vocabulary for its @type established here. (Fnote: this is because you cannot have two <elementSpec> elements with the same @ident and @ns attributes in a single ODD, yet.)

UP TO HERE

element addition section
class deletion section
attribute deletion section
class addition section
other class and macro manipulation section
section for changes to content models of "normal" TEI elements
required element section
attribute constraint section
                  • EXPANSIONS *********
class manipulation subsection
new class subsection
macro addition section
stuff leftover from EMPB that I still need to look at
miscellaneous section
XInclude section