How to edit the TEI Guidelines This document is intended to set out the way things are currently managed in the editing of the TEI Guidelines. General notes on the rationale for this state -- why it is the way it is -- may be added here later. The intention is to provide information for Council members wishing to contribute actively to the continued development and maintenance of the text of the Guidelines. Organization of the Guidelines chapters It cannot have escaped your notice that each chapter (almost) of the Guidelines defines a distinct module. In theory at least, each chapter is organised in more or less the same way: it begins with a paragraph explaining what the module is for, and containing a lot of links to the individual subsections it contains; each subsection introduces a (small) group of elements, usually beginning with a specList, which will typically list all the elements discussed within a given section, listed in whatever order makes sense for the context, but not necessary all possible child elements for a given element; each element is then introduced in turn, usually including an appropriate usage example (on examples, see further #examples); a specGrp for each group of elements defined may be given at the end of each section; a specGrp for the whole module is given at the end of the chapter: it includes the other specifications either directly (by means XIncludes) or indirectly (by means of a specGrpRef pointing to a preceding specGrp). The only chapters not organised in this way are those which do not introduce or define particular modules. Organization of the specifications Each element, class, and macro defined in the Guidelines is declared within its own XML file, containing an elementSpec, classSpec, or macroSpec as appropriate. These files are in the directory Source/Specs. For example, the file Source/Specs/abbr.xml contains the element spec for the abbr element. Note that the elements for the major components of the spec each have a versionDate. If editing the content of the element, you must remember to update the value of this attribute in order to allow for detection of translations (stored in the same file) that need updating. As a general rule, don't update a translation for any language of which you are not a native speaker. If you feel confident enough to adjust the translation, leave the versionDate attribute unchanged on the translation in order to ensure the translation will be reviewed eventually. Each chapter of the Guidelines is stored in a file called Source/Guidelines/xx/YY-name.xml where xx is the language (currently only en or fr), YY is the two letter identifier for each chapter (see #chaptercodes) and name is the name of the module being defined by that chapter. The file Source/guidelines-xx.xml (where xx is either en or fr) is the driver file for the whole shebang. It contains XInclude elements for each of the chapters making up the Guidelines. Hence, to add a new element (say saintName) you might proceed as follows: Write a new file saintName.xml containing an elementSpec for your new element and add it to the Specs folder. Look at other specifications to see which ODD elements to use. Note that we do not use valDesc at this time, instead using only a datatype. Edit the source of the relevant chapter (presumably ND-namesdates.xml in this example) to include a documentation of the element. Use a specList to reference the description from your new spec within the body of the text, like this:

  <p>This module also defines the following canonical element: <specList>
 <specDesc key="saintName"/>
  </specList></p>
and follow up with some discussion of usage.
Also in the relevant chapter, make sure you include an XInclude instruction to bring the specification file for your element into the Guidelines source. Normally you would add it to an existing specGrp element somewhere in the chapter source which already contains similar links:
  <specGrp xml:id="DNDPER" n="Personal and organizational names">
  <include xmlns="http://www.w3.org/2001/XInclude" href="../../Specs/orgName.xml"/>
  <include xmlns="http://www.w3.org/2001/XInclude" href="../../Specs/saintName.xml"/>
  [...]
  </specGrp>
Processing Instructions In some places in the Guidelines source code, you will notice processing instructions which look like this:

          <?insert totalElements?>
        
These processing instructions are replaced during the Guidelines build process by generated content. (That processing takes place in the XSL module P5/Utilities/expand.xsl.) In the case of the example above, the total number of elements defined in the current version of the Guidelines is calculated and inserted. This is a list of the processing instructions currently in use, and what they are replaced by:
<?insert tab-content-models?>
Inserts a generated table of content models into the ST chapter (not likely to be used elsewhere)
<?insert totalElements?>
Inserts a count of the total number of elements defined in the current version
<?insert version?>
Inserts the current version number of the TEI release
If you are writing a Guidelines section that can use one of these variables, feel free to insert the appropriate processing instruction. If you think of other content that could be generated in this way, raise an issue on GitHub so that it can be implemented.
Style Notes General See the Style Guide for Editing the TEI Guidelines, which attempts to state preferred practice on vexed issues issues about spelling, punctuation, etc. The goal of these rules is to avoid inconsistency, and also (wherever possible) to avoid producing text which is markedly either British or American English. Examples The purpose of an example is to illustrate a specific element or feature. Do not include irrelevant encoding which does not contribute to this primary goal. If such encoding is unavoidable (eg to make your example valid), then it must be explained in the supporting text. You may provide supporting explanation for an example in one of two ways: in a p element within the exemplum, or in a remarks element. A p element within an exemplum should only be used for an explanation specific to that particular example. A remarks element should provide explanation for the usage of an element or attribute and need not be tied to a specific example, though it may refer to one. Be careful when writing a supporting explanation not to refer to an example as above or below the explanation, or to indicate the first or second example in a series since the rendering of the Guidelines could change and examples could change order or position as new ones are added. Wherever possible, choose your examples from real documents and provide bibliographic citations for them, either: in a note element, with a place whose value is bottom or foot, following the egXML (if the citation is only a URL in a ptr) in a full bibliographic citation (with or without a URL in ptr) in the file BIB-Bibliography.xml Use the source attribute on the egXML element to link an example to its source. Note that the xml:lang attribute is mandatory on exemplum: this is to ensure that the ODD processor knows which examples to choose in a given context. All examples should be valid against a modified TEI schema in which any element can act as a root element; this validity is checked during the build process. When you have added or edited examples, always check in the following Jenkins build that they are displaying correctly. In particular, note that if your examples include long lines without linebreaks, the result can be a horizontally-scrolling page and a broken table layout in the reference page. If you see this in the output, you can fix it by adding hard-coded linebreaks at suitable points in the example code. Good encoding practice Good encoding practice will ensure not only valid but also highly functional Guidelines. When referencing figures and to other sections of the Guidelines, use ptr, not ref, to ensure that the title and number of the referenced item is automatically inserted when the Guidelines are compiled. The build process validates cross-references. Since the Guidelines is compiled into a single XML document at build time, IDs must be unique across the text and the examples. Consequently, any xml:id attribute values appearing in your examples must be unique within the text of the whole of the Guidelines. Furthermore, any target (etc.) values which do not point to anything in the source will be flagged with a warning during the build process. Making a change to the Guidelines Most changes to the Guidelines are the result of a bug or feature request ticket on GitHub. Once a ticket is assigned to you, and you're sure there is agreement to proceed with the change, follow the steps below. If you don't have a local clone of the git repo, go to the GitHub site and clone the repository following the instructions there. It's usually something like git clone https://github.com/TEIC/TEI.git TEI If you have already checked out a copy, make sure to update it (git pull) before you make any changes in it. Make sure you are on the dev branch (we do not make direct changes to the master branch): git checkout dev Edit the appropriate file(s) to make your changes, or if the change requires it, create a new file. Make sure your source is still valid. The TEI source files should all contain xml-model processing instructions linking them to the latest version of the NVDL file used for validation of the P5 source. If you have a locally installed P5 build environment, make sure you can still build, and that the examples are still valid. You can set up a Docker-based build environment by following the instructions in http://teic.github.io/TCW/testing_and_building.html. If you do not have a build environment nor the means to set one up, just use git to push your updated version to GitHub and wait for our two Jenkins Continuous Integration servers (http://jenkins.tei-c.org/ and http://jenkins2.tei-c.org/) to assess your work. Check in your changes: If the file is new, add it to the git repository: git add filename.xml Commit your changes: git commit -m "Your commit message" filename.xml Be sure to add a detailed commit message which includes a link to the git issue ticket which prompted the change. Push the change to the git repository: git push origin dev Make a note of the revision hash when git receives your change. Assuming the change was successful (see below), add a comment to the GitHub issue ticket which includes the hash of the revision. You may also close the ticket if it is complete. Error messages may appear at any stage. Please do not leave the source in an invalid state (it makes life unnecessarily difficult for others). If you cannot immediately fix a validity error, revert your change while you think about it. Most minor changes, such as edits to explanatory text, can be committed directly to the dev branch. Some edits are more complex, and particularly when these involve multiple files as in adding new elements or changing class specs, it is best to open a new temporary branch to do this work. If it takes some time to complete work on the new branch, you should probably keep the temporary branch up to date with the dev branch with git rebase, since this sets the branch work ahead of the latest commits to dev. (It is also a good idea to ensure that other Council members are not committing edits on the dev branch to the same files that you are working on in the new branch.) For more details on keeping branches up to date, see the Atalassian tutorial on merging vs. rebasing. When your work on the temporary branch is ready for review, push your latest changes and open a pull request. (You can do this by opening the web browser view of the remote TEI GitHub repo, selecting the Pull Requests tab and “New Pull Request”, and comparing your branch to the base dev branch.) Once you have created the pull request, another member of Council should approve it. You can assign specific Council members to this task, or assign the entire Council as a team with @TEIC/tei-technical-council. Bear in mind that our Jenkins servers only build the dev branch, so you cannot depend on them to test-build your working branch. If you need regular test-builds for your branch, or you would like to be able to share the results of your branch build with others while you're working on it, you can ask one of the Jenkins maintainers to set up a temporary build job for your branch. A pull request should only be approved when its contents pass the Jenkins server tests. The Council member who approves a pull request should delete the temporary branch once its content has been merged into dev. The Jenkins servers monitor the Git repository, and when they detect a change, they check it out and commence building several targets, just as you would build them on your local machine. There are a couple of advantages to letting the Jenkins servers check your build for you: You don't have to have all the various packages and other software required for a build installed on your system. This means you can make a quick fix to the Guidelines on any computer you happen to be using, without installing a lot of extra software. The required packages on the Jenkins servers tend to be updated regularly, and we're watching them to make sure they work properly. Jenkins attempts to let you know by email if there's a problem, and provides useful debugging tools. If you submit a change, and later get an email from one of the Jenkins servers telling you that the build failed, it will provide a link to the build information on the server. Here's what to do: First, check that the build is broken on both Jenkins servers. If it's only broken on one of them, it may have been caused by a lag in updates to packages on that server. If both servers have completed a build since your commit, and both are showing an error, then you need to check where the error is occurring. On the page for that build on the Jenkins server site, click on Parsed Console Output on the left menu. You'll see links to Errors and Warnings; these will show you the exact point in the build script where the errors or warnings occurred. This may give you a useful clue to the cause of the failure. If you still can't figure out the problem, email the Council list with a link to the build information, and someone will be able to help. Once you know what the problem is, fix it by editing the source again and committing the change to the git repository. Jenkins will then do its stuff, and you'll know whether your fix worked as expected. Error messages appearing during the make test phase (the TEIP5-Test job on Jenkins) usually indicate that your changes are in conflict with the Birnbaum Doctrine, which decrees that changes in the Guideline schemas should not invalidate existing documents. You may wish to discuss the specific issue with other Council members. Images If you use an image in your Guidelines change, you will need to add it to the git repository in the P5/Images directory. If you have asked for and received permission from a rights-holder to use the image, include all of the relevant correspondence in a zip file named the same as the image file (so for an image fred.png, include permission documents in a file called fred.zip). Adding or Editing an Appendix The Appendices to the TEI Guidelines mostly constitute lists of features (elements, attributes, classes etc.) which have been automatically harvested from the Guidelines compiled source (p5.xml or p5subset.xml) during the build process. When adding a new appendix of this type, you need to: Create a new APPENDIXTHING.xml file in the TEI/P5/Source/Guidelines/en/ folder. Model this on the already-existing files for other appendices. The basic pattern is to provide a very short introduction to the list you're creating (see below). The convention is to name this file with an all-caps name followed by lower-case .xml. Add a line to TEI/P5/Source/guidelines-en.xml (right near the end of the file) to XInclude your file in the Guidelines. Again, follow the examples already there. Put your new appendix in the sequence in a location that makes sense in relation to the other appendices. If your appendix listing is to be created automatically, edit the appropriate file in the Stylesheets repository (most likely Stylesheets/common/common_tagdocs.xsl) to enable it to generate the list or table (see below). If your auto-generated appendix content uses headings that should be translated for other language versions of the Guidelines, add the appropriate language entries to Stylesheets/i18n.xml (if they're not already there). Auto-generated appendix listings will require two things: a TEI divGen element which acts as a trigger to cause the list to be generated, and a Stylesheets template which processes the divGen to create the output. For example, the list of deprecations consists of this DEPRECATIONS.xml file:

<div type="div1" xml:id="DEPRECATIONS">
  <head>Deprecations</head>
  <div>
    <head>About the Deprecation Appendix</head>
    <p>This appendix gives you a list of all items (elements,
      attributes, attribute values, datatypes etc.) which are deprecated
      in this revision of the TEI Guidelines (revision <?insert
revision?> of TEI P5 <?insert version?>).</p>
  </div>
  <divGen type="deprecationcat"/>
</div>    
Note that there are two kinds of auto-generated content here: first, the two processing instructions <?insert revision?> and <?insert version?>, which are self-explanatory and can simply be used, and <divGen type="deprecationcat"/>, which was created specifically for this appendix file, and for which processing had to be explicitly written. If you now look at Stylesheets/common/common_tagdocs.xsl, you'll find this template:
  <xsl:template match="tei:divGen[@type = 'deprecationcat']">
    <xsl:element namespace="{$outputNS}" name="{$tableName}">
      <xsl:attribute name="{$rendName}">
        <xsl:text>deprecationcat</xsl:text>
      </xsl:attribute>
      <!-- .. -->
    </xsl:element>
  </xsl:template>
This template creates a table in whatever the target output format is, listing the deprecations. Note that the table headings are created like this:
  <xsl:element namespace="{$outputNS}" name="{$cellName}">
    <xsl:element namespace="{$outputNS}" name="{$hiName}">
      <xsl:attribute name="{$rendName}">
        <xsl:text>label</xsl:text>
      </xsl:attribute>
      <xsl:attribute name="{$langAttributeName}">
        <xsl:value-of select="$documentationLanguage"/>
      </xsl:attribute>
      <xsl:sequence select="tei:i18n('Identifier')"/>
    </xsl:element>
  </xsl:element>
where the keyword Identifier is used to look up the appropriate language translation in the Stylesheets/i18n.xml file. If those items already exist in the file, you can simply use them, but if you are creating headings which do not yet have entries, you will need to add them to Stylesheets/i18n.xml like this:

<entry>
  <key>Identifier</key>
  <text xml:lang="en" lang3="eng">Identifier</text>
</entry>  
and if you are competent to add the equivalent translations in any of the Guidelines languages, you can add them alongside the English version:

<entry>
  <key>Description</key>
  <text xml:lang="en" lang3="eng">Description</text>
  <text xml:lang="de" lang3="deu">Beschreibung</text>
  <text xml:lang="fr" lang3="fra">Description</text>
  <text xml:lang="it" lang3="ita">Descrizione</text>
</entry>  
Only when all these pieces are in place can the new appendix function correctly. It would normally be appropriate to do work on this scale in a branch of the repo, but this is a little complicated by the fact that you need to edit two repositories separately. It is fine to make the changes in the TEI repository first, resulting in an appendix page that simply lacks its listing, then do the Stylesheets changes to make the listing.
Of course, a simple manual appendix consisting of some explanatory prose can be created simply by adding the APPENDIXTHING.xml file and XIncluding it in guidelines-en.xml, with no Stylesheets changes required.
Adding Schematron constraints to specifications The TEI ODD system is primarily concerned with generating schemas in the form of RelaxNG or XML Schema. However, there are often circumstances in which you want to apply constraints to elements and attributes which cannot easily be captured by normal XML schemas. For instance, you might want to apply a co-occurrence constraint on some attributes. The targetLang attribute is a good example. targetLang is an optional attribute which “specifies the language of the content to be found at the destination referenced by target, using a language tag generated according to BCP 47.” Obviously, there is no point in using targetLang if you're not also using target. However, many such co-occurrence constraints are difficult to express in RelaxNG schemas, and may not survive conversion to other schema formats such as XML Schema or DTD. For this reason, we often use ISO Schematron to express constraints like this. If you look in att.pointing.xml, where the targetLang attribute is defined, you'll find this constraint, inside the attDef for targetLang:

<constraintSpec ident="targetLang" scheme="isoschematron">
  <constraint>
    <rule context="tei:*[not(self::tei:schemaSpec)][@targetLang]" role="error">
      <assert test="count(@target)">@targetLang can only be used if 
        @target is specified.</assert>
    </rule>
  </constraint>
</constraintSpec>          
          
This Schematron rule is an assertion that if targetLang is used, target should also be present. constraintSpec has an attribute scheme (normally set to isoschematron). Inside constraintSpec, constraintss hold elements in the Schematron namespace. The Schematron rule element establishes the TEI node to be tested with its context attribute. The rule holds one or more elements, either assert or report that define conditions to be checked in a test attribute. Here we see an assert element, which has test attributes. The test attribute value is always an XPath expression; if the XPath tests false, the assertion will be triggered, and its contents will appear on the console when you build or validate. There is also a report element which is similar, but which triggers when true rather than when false, so you can check both positive and negative conditions. In Roma, you can also generate a Schematron schema which you can also use to test your document against. This document is essentially a compilation in Schematron of all the TEI constraints. The operation of checking a document with Schematron is independent of any other validation processes that take place using other schemas. Notice, finally, the role attribute, set in our example on the rule element. This attribute defines a level of severity for the test if its test passes with a Boolean true result in a report, or if the test fails with a Boolean false result in a assert. Values for role basically define three levels of severity, for which we use standard Schematron values: with "fatal" and "error" as the most extreme values, "warning" as a gentle caution, and "info" to provide neutral information. When no role attribute is set, the default severity in Schematron is "error". The role attribute can be applied either to the Schematron rule element or to its assert and report children, which can have differing levels of severity. For a full introduction to Schematron, see the Schematron website. constraintSpec can appear as a child of attDef, classSpec, elementSpec, macroSpec, and schemaSpec. We'll go through the process of adding a constraint like the one above. The constraint we're going to add relates to dating elements (date, birth etc.) and the calendar attribute. calendar indicates the system or calendar to which the date represented by the content of this element belongs. In other words, calendar should only be used if the dating element has textual content. This makes sense (assuming that calendar points at a valid calendar element):

<date calendar="#julian">January, 1622</date>            
            
whereas this is not:

<date when="1622" calendar="#julian"/>            
            
because the date element has no textual content to which the calendar attribute could apply. We're going to express this in the form of a Schematron constraint, along the lines of the one we've examined above. First, we open the att.datable.xml file, and find the attDef element which defines calendar. We can add the constraintSpec element immediately after the datatype element, like this:

<constraintSpec ident="calendar" scheme="isoschematron">
  <constraint>
    <rule context="tei:*[@calendar]">
      <assert test="string-length(.) gt 0">
        @calendar indicates the system or calendar 
        to which the date represented by the content 
        of this element belongs, but this element 
        has no textual content.
      </assert>
    </rule>
  </constraint>
</constraintSpec>  
  
(Obviously, by the time you're reading this, the constraintSpec is already in the TEI source, so you'll see it there.) If the Schematron namespace is not already defined somewhere in the file, we'll also have to make sure we add it; in this case, I defined the prefix in the classSpec root element: xmlns:sch="http://purl.oclc.org/dsdl/schematron". Then we commit our changes, and let the TEI build process build all the products, and make sure that we didn't get anything wrong.
When writing Schematron constraints for the Guidelines, bear these points in mind: Ensure that the context item for the rule is an element, not an attribute, as in the example above. For technical reasons, the Schematron processing in the build process will generate error messages if the context item is an attribute. Break up the message up into fairly short lines, so that it's easy to read when it appears in the build log. Use the name element in place of the name of the context element. This will be helpful for future processing needs. Refer to attributes using the "@" prefix, rather than quotation marks or plain names (as above). The Schematron constraint above should cover what we're trying to accomplish. However, it's quite difficult for us to test whether it is in fact doing exactly what it should be, unless we build a new copy of Roma and use it to generate a Schematron schema, then validate a test document against it. This is probably not practical for most of us. Fortunately, the TEI build system provides a way for us to do this; in fact, we can put in place a couple of tests that will always be run whenever P5 is built, checking that our Schematron constraint is intact and functioning as we expect. The first thing we're going to do is add a couple of tests that should pass. We'll add a dating element which has both calendar and some textual content, as well as an empty dating element with no textual content. If these tests pass, then we know that our constraint is not doing anything wrong. (We don't yet know whether it's doing anything at all, of course; that comes later.) If you look at trunk/P5/Test, you'll see there is a whole folder full of files whose purpose is to test various aspects of the TEI build process and products. We want to add our tests to one of these files. The question is which one? We'll add it to the basic test file, which is testbasic.xml; this is tested against schemas generated from testbasic.odd, which should contain all the dating features we're interested in testing. If we look at that file, we find there are already several date elements in there, so we can try adding our calendar attribute to one of those. Let's choose the date of 1685 on a dictionary entry sense:

<sense>
  <date calendar="http://en.wikipedia.org/wiki/Julian_calendar">1685</date>
  <form>
    <orth>pamplemousse </orth>
  </form>
</sense>            
            
We could go to the trouble of adding calendarDesc and calendar to the header of the file so we can point to a calendar element in the same document, but since calendar is a data.pointer, we can point to an external source of calendar information.
We also want to add, somewhere, a date element which has no textual content and no calendar attribute. We might as well do this in the header, by adding a simple revisionDesc element, which gives us the added bonus of being able to describe our change:

<revisionDesc>
  <change><date when="2012-09-06"/>MDH: Added @calendar to one date, and the date 
    element in here, for testing a new Schematron constraint.</change>
</revisionDesc>            
            
Now we can commit our change, and see if the build of TEIP5-Test completes successfully on our Jenkins servers.
If that build successfully completes, we haven't broken anything. But we still don't know whether our constraint will actually fire when something is wrong. In order to do that, we have to use the "detest" system. In trunk/P5/Test, you'll find the following files: expected-results/detest.log detest.odd detest.xml detest.odd and detest.xml are test files like the ones we've seen above, but the purpose of the detest files is to introduce deliberate errors and make sure that the testing process throws up the expected error results. What happens is basically this: Schemas are built from detest.odd (including a Schematron schema). The file detest.xml is validated against those schemas. Resulting error messages are collected in a file called detest.log (in the Test directory). That file is compared with the detest.log file in the expected-results subdirectory. If they are not identical, the test build fails. So what we need to do is to add some new markup to detest.xml which is designed to fail our Schematron test. The problem is that we cannot reliably predict how it will fail—in other words, we can't know in advance what the resulting detest.log file should look like, because we can't know in what order the tests will run, and what the precise error messages might be. We could find this out if we had a working local build environment of our own, but it's far simpler to let Jenkins do the job for us. So this is what we'll do: Add our new test to detest.xml. Commit the change to the git repository. Let Jenkins run the build (which should fail). Examine the resulting detest.log on Jenkins, and copy it to our local expected-results/detest.log. Commit that change to the repository. Let Jenkins build again, and make sure that the build completes successfully. We'll add this div to the detest.xml file:

<div>
  <p>Added by MDH. This tests the Schematron constraint that any element with 
        @calendar must have some textual content.</p>
  <p><date when="2012-09-06" calendar="http://en.wikipedia.org/wiki/Gregorian_calendar"/></p>
</div>
Now we commit the change to git, and Jenkins will start building. The build should fail, and it does. If we now go to the Jenkins workspace on one of our two build servers: https://jenkins.tei-c.org/job/TEIP5-Test-dev/ws/P5/Test/ https://jenkins2.tei-c.org/job/TEIP5-Test-dev/ws/P5/Test/ we'll see a file called detest.log, and if we look inside it, we'll find this bit, generated by our constraint: @calendar indicates the system or calendar to which the date represented by the content of this element belongs, but this element has no textual content. (string-length(.) gt 0) This line is obviously missing from expected-results/detest.log, so the build failed when the two files were compared. We can fix that very simply: Download the detest.log file from the TEIP5-Test workspace on the Jenkins server (job/TEIP5-Test/ws/Test/). Copy its contents into our local file expected-results/detest.log. Commit this change to git (git commit followed by git push). Watch Jenkins build P5-Test again, and make sure it completes successfully.
Building the release Note: the original content of this section has been removed, because a longer document dedicated to documenting the release process has been created. Please refer to TCW22: Building a TEI Release. Reference section Chapter codes Following a lengthy debate in the Council as to whether the two-character codes originally used to identify individual chapters should be dropped in favour of longer more human-readable names, a compromise solution was reached in which the two character codes were retained as prefixes to longer human-readable names. The same two-character codes are also used to identify the HTML and PDF files generated during the release process. The following table shows the correspondence between the printed organization of the Guidelines and the corresponding filenames. The order is determined by the driver file Source/guidelines-xx.xml, from which the table is derived. SectionTitlefilename [i]Releases of the TEI Guidelines TitlePageVerso.xml [ii]Dedication Dedication.xml [iii]Preface and Acknowledgments FM1-IntroductoryNote.xml [iv]About These Guidelines AB-About.xml [v]A Gentle Introduction to XML SG-GentleIntroduction.xml [vi]Languages and Character Sets CH-LanguagesCharacterSets.xml [1]The TEI Infrastructure ST-Infrastructure.xml [2]The TEI Header HD-Header.xml [3]Elements Available in All TEI Documents CO-CoreElements.xml [4]Default Text Structure DS-DefaultTextStructure.xml [5]Representation of Non-standard Characters and GlyphsWD-NonStandardCharacters.xml [6]VerseVE-Verse.xml [7]Performance Texts DR-PerformanceTexts.xml [8]Transcriptions of Speech TS-TranscriptionsofSpeech.xml [9]Dictionaries DI-PrintDictionaries.xml [10]Manuscript Description MS-ManuscriptDescription.xml [11]Representation of Primary Sources PH-PrimarySources.xml [12]Critical Apparatus TC-CriticalApparatus.xml [13]Names, Dates, People, and Places ND-NamesDates.xml [14]Tables, Formulæ, and Graphics FT-TablesFormulaeGraphics.xml [15]Language Corpora CC-LanguageCorpora.xml [16]Linking, Segmentation, and Alignment SA-LinkingSegmentationAlignment.xml [17]Simple Analytic Mechanisms AI-AnalyticMechanisms.xml [18]Feature Structures FS-FeatureStructures.xml [19]Graphs, Networks, and Trees GD-GraphsNetworksTrees.xml [20]Non-hierarchical Structures NH-Non-hierarchical.xml [21]Certainty, Precision, and Responsibility CE-CertaintyResponsibility.xml [22]Documentation Elements TD-DocumentationElements.xml [23]Using the TEI USE.xml [A1]Model Classes REF-CLASSES-MODEL.xml [A2]Attribute Classes REF-CLASSES-ATTS.xml [A3]Elements REF-ELEMENTS.xml [A4]Attributes REF-ATTRIBUTES.xml [A5]Datatypes and Other Macros REF-MACROS.xml [A6]Bibliography BIB-Bibliography.xml [A7]Prefatory Notes PrefatoryNote.xml [A8]Colophon COL-Colophon.xml In most chapters, the two character code is also used as a prefix for the xml:id values given to each div element. Note that every div element carries an xml:id value, whether or not it is actually referenced explicitly elewhere in the Guidelines. Note that files with names beginning REF contain only divGen elements: their content, which provides the reference documentation (sections A1 to A5 inclusive), is automatically generated during the build process. Naming conventions TEI naming conventions have evolved over time, but remain fairly consistent.
generic identifiers
An element and attribute identifiers should be a single natural language word in lowercase if possible. If more than one word is conjoined to form a name, then the first letter of the second and any subsequent word should be uppercased. Hyphens, underscores, dots etc are not used within element or attribute names.
class names
Class names are made up three parts: a name, constructed like an element name, with a prefix and optionally a suffix. The prefix is one of model. or att. and indicates whether this is a model or an attribute class. The suffix, if present, is used to indicate subclassing: for example att.linking.foo is the foo subclass of the attribute class att.linking
xml:id values
The conventions for these vary somewhat. Most of the older chapters of the guidelines have consistently constructed identifiers, derived from the individual section headings. Identifiers must be provided for: every div, whether or not it is explicitly linked to elsewhere every bibliographic reference in the BIB-Bibliography.xml file
File release structure Currently, the organisation of the /usr/share/xml/tei and /usr/share/doc/tei-* directories on the TEI web site is as follows:
tei
|-- Test
|-- custom
|   |-- odd
|   |-- schema
|   |   |-- dtd
|   |   |-- relaxng
|   |   `-- xsd
|   `-- templates
|-- odd
|   |-- Exemplars
|   |-- ReleaseNotes
|   |-- Source
|   |   |-- Guidelines
|   |   |   |-- en
|   |   |   |   `-- Images
|   |   |   `-- fr
|   |   |       `-- Images
|   |   |-- Images
|   |   `-- Specs
|   |       |-- 18decembre
|   |       `-- exemples
|   |-- Utilities
|   `-- webnav
|       `-- icons
|-- schema
|   |-- dtd
|   `-- relaxng
|-- stylesheet
|   |-- common
|   |-- common2
|   |-- docx
|   |   |-- from
|   |   |   |-- dynamic
|   |   |   |   `-- tests
|   |   |   |       `-- xspec
|   |   |   |-- graphics
|   |   |   |-- lists
|   |   |   |-- marginals
|   |   |   |-- maths
|   |   |   |-- paragraphs
|   |   |   |-- pass0
|   |   |   |-- pass2
|   |   |   |-- tables
|   |   |   |-- templates
|   |   |   |-- textruns
|   |   |   |-- utils
|   |   |   `-- wordsections
|   |   |-- misc
|   |   |-- to
|   |   |   |-- docxfiles
|   |   |   |-- drama
|   |   |   |-- dynamic
|   |   |   |-- graphics
|   |   |   |-- lists
|   |   |   |-- maths
|   |   |   |-- templates
|   |   |   `-- wordsections
|   |   `-- utils
|   |       |-- graphics
|   |       |-- identity
|   |       |-- maths
|   |       `-- verbatim
|   |-- epub
|   |-- fo
|   |-- fo2
|   |-- html
|   |-- latex
|   |-- latex2
|   |-- nlm
|   |-- odds
|   |-- odds2
|   |-- oo
|   |-- profiles
|   |   |-- bodley
|   |   |   `-- epub
|   |   |-- default
|   |   |   |-- csv
|   |   |   |-- docbook
|   |   |   |-- docx
|   |   |   |-- dtd
|   |   |   |-- epub
|   |   |   |-- fo
|   |   |   |-- html
|   |   |   |-- latex
|   |   |   |-- lite
|   |   |   |-- oddhtml
|   |   |   |-- oo
|   |   |   |-- p4
|   |   |   `-- relaxng
|   |   |-- enrich
|   |   |   |-- docx
|   |   |   |-- fo
|   |   |   |-- html
|   |   |   `-- latex
|   |   |-- iso
|   |   |   |-- docx
|   |   |   |   `-- model
|   |   |   |-- epub
|   |   |   |-- fo
|   |   |   |-- html
|   |   |   |-- latex
|   |   |   |-- schema
|   |   |   `-- tbx
|   |   |-- ota
|   |   |   |-- epub
|   |   |   `-- html
|   |   |-- oucs
|   |   |   |-- docx
|   |   |   |-- epub
|   |   |   `-- p4
|   |   |-- oucscourses
|   |   |   `-- docx
|   |   |-- podcasts
|   |   |   |-- docx
|   |   |   `-- epub
|   |   `-- tei
|   |       `-- epub
|   |-- slides
|   |-- slides2
|   |-- tite
|   |-- tools2
|   |-- xhtml
|   `-- xhtml2
`-- xquery

Some other (mostly superceded) documents on the topic TEI ED W9 Points of Style For Drafts of TEI Guidelines 2 Mar 1990 in Waterloo Script format Notes on House Style TEI ED W11 14 Sep 1992 in Waterloo script formatted text TEI ED W55 Form for Draft Chapters of the TEI Guidelines 5 june 1996 in TEI P2 format in HTML format in ODD format TEI ED W57 Procedures for Correcting Errors in the TEI Guidelines July 23, 1994 in TEI P2 format in HTML format