Added element

  <elementSpec ident="airport" ns="http://www.MYINSTITUTION.edu/MYPROJECT/ns/1.0">
    <desc>provides structured information about a particular airport</desc>
    <classes>
      <memberOf key="model.placeLike"/>
      <memberOf key="att.global"/>
      <memberOf key="att.sortable"/>
    </classes>
    <content>
      <sequence>
        <elementRef key="name" minOccurs="1" maxOccurs="unbounded"/>
        <classRef key="model.descLike"/>
        <elementRef key="location"/>
      </sequence>
    </content>
    <attList>
      <attDef ident="runway">
        <datatype minOccurs="1" maxOccurs="1">
          <dataRef key="teidata.word"/>
        </datatype>
        <constraintSpec ident="runway-name" scheme="isoschematron">
          <constraint>
            <sch:rule context="@runway">
              <sch:assert test="matches( normalize-space(.), '^([0-2]?[0-9]|3[0-6])[LCR]?(/([0-2]?[0-9]|3[0-6])[LCR]?)?$')">
                A runway is identified by a number from 01 to 36
                (its heading in decadegrees), optionally followed
                by L (left), C (center), or R (right); optionally
                followed by the same designation from the opposite
                direction. E.g., "9L/27R".
              </sch:assert>
            </sch:rule>
          </constraint>
        </constraintSpec>
      </attDef>
    </attList>
    <exemplum>
      <egXML xmlns="http://www.tei-c.org/ns/Examples">
        <mimp:airport xmlns:mimp="http://www.MYINSTITUTION.edu/MYPROJECT/ns/1.0" type="municipal" sortKey="KMLI" runway="5/23">
          <name>Quad City International Airport</name>
          <desc>Third busiest airport in <placeName>Illinois</placeName></desc>
          <location>
            <address>
              <addrLine>2200 - 69th Avenue</addrLine>
              <addrLine>Moline, IL 61265</addrLine>
            </address>
            <geo>41.448872 -90.506122</geo>
          </location>
        </mimp:airport>
      </egXML>
    </exemplum>
    <remarks>
      <p>Only intended for airports with one runway.</p>
    </remarks>
  </elementSpec>

In this example, we are adding the element <airport> to our schema. It is a member of model.placeLike, so it fits in the same places that <place> would within a TEI document. It is also a member of att.global (which gives the element attributes like xml:id and xml:lang) and att.sortable (which gives the element the attribute @sortKey).

The <content> element provides us with information about what <airport> can contain. Here we see it must include at least one <name> element, any number of things from model.descLike, and the <location> element.

It also contains an attribute @runway, which is required and can occur only once. The <constraintSpec> element contains an isoschematron specification for what content is allowed as a value of @runway. (we will discuss schematron later in the tutorial).

There is then an example of how to use <airport> within an xml document, as well as remarks on how the element should be used.

Introduction to Writing ODDs slide 19 of 24
© 2010 Syd Bauman, Julia Flanders, and the Women Writers Project This TEI-encoded XML file is available under the terms of the Creative Commons Attribution-ShareAlike 3.0 (Unported) license.