<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="../../../_utils/schema/yaps.rnc" type="application/relax-ng-compact-syntax"?>
<?xml-model href="../../../_utils/schema/yaps.isosch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<?xml-stylesheet type="text/css" href="../../../_utils/stylesheets/yaps-tei.css"?>
<!-- $Id: basic_odd_simple.xml 51709 2026-05-28 23:29:13Z syd $ -->
<TEI xmlns="http://www.wwp.northeastern.edu/ns/yaps" xmlns:yaps="http://www.wwp.northeastern.edu/ns/yaps" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>Introduction to Writing ODDs</title>
        <author xml:id="SB">Syd Bauman</author>
        <author xml:id="JF">Julia Flanders</author>
      </titleStmt>
      <editionStmt>
        <edition>Introduction to TEI Encoding and Schema Design, Northeastern University, 2018-04</edition>
      </editionStmt>
      <publicationStmt>
        <distributor>Women Writers Project (via website)</distributor>
        <address>
          <addrLine>url:mailto:wwp@northeastern.edu</addrLine>
        </address>
        <date when="2018-04-06"/>
        <availability status="restricted">
          <p>Copyright 2010 Syd Bauman, Julia Flanders, and the Women Writers Project</p>
          <p>This TEI-encoded XML file is available under the terms of the <ref
          target="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons
          Attribution-ShareAlike 3.0 (Unported)</ref> license.</p>
        </availability>
        <pubPlace>Boston, MA USA</pubPlace>
      </publicationStmt>
      <sourceDesc>
        <p>A simpler coverage than basic_odd.xml of basic and
        intermediate elements for ODD-writing, using examples:
        including modules and elements, changing and constraining
        attributes, datatypes, <att>mode</att>. This presentation is
        intended to be used in two parts with hands-on practice in
        between. </p>
      </sourceDesc>
    </fileDesc>
    <revisionDesc>
      <change when="2015-10-12" who="personography.xml#sstanley.fxj">Began adding tutorials</change>
      <change when="2015-03-14" who="personography.xml#sstanley.fxj">Added <gi>abstract</gi> to
      presentation</change>
      <change when="2012-06-22" who="#JF">Created file based on basic_odd.xml, removing and
      compressing some slides based on notes from 2012-06-21 meeting with SB.</change>
    </revisionDesc>
  </teiHeader>
  <text>
    <presentation>
      <abstract>
        <p>This tutorial covers the mechanics of ODD customization:
        How to either delete or include elements from the generic TEI
        schema; how to change delete attributes by class or for
        specific elements; how to constrain lists of attribute values,
        or change the content that can go within a given element. For
        this tutorial, it is probably best to follow along with your
        XML editor open, so that you can try out different
        customizations as you go.</p>
      </abstract>
      <section>
        <head>Writing ODD files by hand</head>
        <slide>
          <p>Let's bear in mind: An ODD file is just a specialized TEI
          file, with elements that say things like:
          <list>
            <item><said>Include this element!</said></item>
            <item><said>Delete this element!</said></item>
            <item><said>Change this attribute!</said></item>
            <item><said>Replace the default definition with my custom definition!</said></item>
            <item>… and of course <said>Here's what it means and why I did it!</said></item>
          </list>
          </p>
        </slide>
        <lectureNote>
          <p>A few things that are useful to remind ourselves of and
          bear in mind before we start:
          <list>
            <item>An ODD file is just a TEI file (with a bunch of
            unusual and special-purpose elements in it)</item>
            <item>It serves two functions: to express the
            customizations you've made, in formal terms, and to
            document those customizations (we're going to focus
            right now on expressing the customizations, but we'll
            talk about documentation a little alter on)</item>
            <item>When the ODD file is processed (e.g., by <name
            type="cmd">roma</name>), the elements that express
            schema modifications are used to affect the generation
            of your custom schema, and the documentation elements
            are used in generating your custom documentation.</item>
          </list>
          </p>
          <p>What are these specialized elements doing? They're saying things like: <list>
          <item><said>Include this element!</said></item>
          <item><said>Delete this element!</said></item>
          <item><said>Change this attribute!</said></item>
          <item><said>Replace the default definition with my custom definition!</said></item>
          <item>....and of course <said>Here's what it means and why I did it!</said></item>
        </list>
          </p>
        </lectureNote>
        <tutorial>
          <p>There are a few things that are useful to remind
          ourselves of before we start.
          <list>
            <item>First, an ODD file is just a TEI file with a bunch
            of special-purpose elements in it. An ODD file is
            associated with a TEI schema.</item>
            <item>Second, it serves two functions: to express the
            customizations you've made, and to document those
            customizations.</item>
            <item>Third, when the ODD file is processed, there are
            two different types of elements: those that express
            schema modifications and those that are meant for
            documentation. The elements that express schema
            modifications affect the generation of your custom
            schema, and the documentation elements are used to
            generate your custom documentation.</item>
          </list>
          </p>
          <p>What are these specialized elements doing? They're saying things like: <list>
          <item><said>Include this element!</said></item>
          <item><said>Delete this element!</said></item>
          <item><said>Change this attribute!</said></item>
          <item><said>Replace the default definition with my custom definition!</said></item>
          <item>...and of course <said>Here's what it means and why I did it!</said></item>
        </list>
          </p>
        </tutorial>
      </section>

      <section>
        <head>Including Modules</head>
        <slide>
          <p>To include a TEI module in your schema:</p>
          <egMarkup scheme="TEI" type="valid">
            <moduleRef key="core"/>
            <moduleRef key="tei"/>
            <moduleRef key="header"/>
            <moduleRef key="textstructure"/>
            <moduleRef key="namesdates"/>
          </egMarkup>
        </slide>
        <lectureNote>
          <p>So we're going to start out by talking about how to work
          with elements in your customization, and then we'll try this
          out in practice; then we'll talk about how to modify
          attributes (and try that out), and finally look at managing
          classes and the big picture.</p>
          <p>The most basic thing you can do in a TEI customization
          (and the most obligatory) is to specify what modules you'll
          be including in your schema. Let's remind ourselves that
          modules are equivalent to chapters in the Guidelines, and
          they are organized topically: for instance, there are
          modules on drama, on linking, on the transcription of
          primary sources.</p>
          <p>To include a module in your schema, use the
          <gi>moduleRef</gi> element; the <att>key</att> attribute
          tells us what module we're including.</p>
          <p>Note that when you include a module, you're going to get
          all the elements, classes, and macros from that module in
          your schema.</p>
        </lectureNote>
        <tutorial>
          <p>The most basic thing you can do in a TEI customization
          (and the most obligatory) is to specify what modules you'll
          be including in your schema. Remember that modules are
          equivalent to chapters in the TEI Guidelines, and they are
          organized topically. For instance, there are modules on
          drama, linking, and the transcription of primary
          sources.</p>
        </tutorial>
      </section>

      <section>
        <head>Example</head>
        <slide>
          <p>Note that there are four required modules to make a
          conforming TEI customization:</p>
          <egMarkup scheme="TEI" type="valid">
            <body>
              <schemaSpec ident="demo01">

                <!-- required modules -->
                <moduleRef key="tei"/>           <!-- has underpinnings of TEI class system -->
                <moduleRef key="core"/>          <!-- has <title>, <p>, <emph>, etc. -->
                <moduleRef key="header"/>        <!-- has <teiHeader>, <fileDesc>, etc. -->
                <moduleRef key="textstructure"/> <!-- has <TEI>, <text>, <div>, etc. -->

                <!-- optional modules -->
                <moduleRef key="namesdates"/>
                <moduleRef key="transcr"/>
                <moduleRef key="analysis"/>

              </schemaSpec>
            </body>
          </egMarkup>
        </slide>
        <lectureNote>
          <p>So here's a little tiny customization...</p>
        </lectureNote>
        <tutorial>
          <p>This is an example of what your module selection may look
          like. You will use the <gi>moduleRef</gi> element to specify
          which modules you want to include. If there's an module you
          want to delete, just omit it from the <gi>moduleRef</gi>
          section.</p>
          <p>Note that there are four required modules: tei, core,
          header, and textstructure. These are all necessary for the
          creation of a TEI document, so don't forget to include
          them!</p>
        </tutorial>
      </section>

      <section>
        <head>Trimming your modules</head>
        <slide>
          <p>To delete specific elements from the modules you selected:
          <egMarkup scheme="TEI" type="valid">
            <moduleRef key="namesdates" except="addName affiliation bloc climate"/>
          </egMarkup></p>
          <p>To include specific elements from the modules you selected:
          <egMarkup scheme="TEI" type="valid">
            <moduleRef key="textstructure" include="TEI text div back body"/>
          </egMarkup>
          </p>
          <p>Two important tips:
          <list>
            <item>you can't use both at once for the same <gi>moduleRef</gi>!</item>
            <item>be careful that the elements listed are actually in the module specified!
            </item>
          </list></p>
        </slide>
        <lectureNote>
          <p>What if there are a few elements in a given module that
          you <emph>don't</emph> want? or what if there are only a few
          that you <emph>do</emph> want?</p>
          <p>You can specify which elements from the module will be
          included in your schema, using <att>except</att> or
          <att>include</att></p>
          <p>The <att>except</att> attribute on <gi>moduleRef</gi>
          lists which elements defined by the given module will
          <emph>not</emph> be included.</p>
          <p>The <att>include</att> attribute on <gi>moduleRef</gi>
          lists which elements defined by the given module
          <emph>will</emph> be included</p>
          <p>Two important gotchas to remember here: <list>
          <item>It's important to note that you can't use both
          mechanisms on the same <gi>moduleRef</gi>, but you can
          use <att>include</att> on one <gi>moduleRef</gi> and
          <att>except</att> on another.</item>
          <item>Make sure that the elements listed are actually in
          the module specified, and that they aren't misspelled:
          you will get an unhelpful error message from
          tei_customization, but other schemas won't flag an
          error; in any case things Just Won't Work...</item>
        </list>
          </p>
          <p>What's the difference between these two approaches? (ask for ideas)
          <list>
            <item>efficiency (how many elements you have to list)</item>
            <item>how about when the TEI changes and you regenerate your schema?</item>
          </list>
          </p>
        </lectureNote>
        <tutorial>
          <p>So what if there's a module that you want only
          <emph>some</emph> elements from? The TEI provides you with
          two mechanisms for trimming down modules by individual
          elements: with the <att>include</att> and <att>except</att>
          attributes (not exclude!!).</p>
          <p>There are two things that are important to keep in mind
          when using these attributes. The first is that you cannot
          use both attributes on one <gi>moduleRef</gi>; you have to
          pick just one. You can, however, switch it up for different
          <gi>moduleRef</gi> elements, using <att>include</att> on one
          and <att>except</att> on the other.</p>
          <p>The second thing to keep in mind is that spelling is
          important!! You may not immediately get an error message if
          you accidentally spell <q>castList</q> as <q>catsList.</q>
          But this <emph>will</emph> cause you problems later, when
          you try to generate a schema.</p>
          <p>So what is the difference between using the
          <att>include</att> and <att>except</att> attributes (besides
          the fact that one <emph>includes</emph> the element names
          listed as values, and the other <emph>excludes</emph> them)?
          For one, you may choose one attribute for the sake of
          efficiency. If you want to include all but two elements from
          a given module, the <att>except</att> attribute will
          probably be easier to manage.</p>
          <p>However, it's also useful to think about the TEI and how
          it changes over time. What would happen if you used the
          <att>include</att> attribute for a given module, and the TEI
          added an element to that module? You wouldn't get that new
          element when the TEI updated, because only the listed
          elements would be included in your schema. The same goes for
          the <att>except</att> attribute, which may cause you to get
          new elements you don't want.</p>
          <p>This is not to say that you should necessarily choose one
          over the other; both options have their benefits and
          downsides. However, it is important to keep in mind that
          your customization applies to <emph>one version</emph> of
          the TEI, but since the TEI is constantly changing, your
          customization will need to be updated or cleaned out from
          time to time. The process of customization isn't necessarily
          a one-time thing.</p>
        </tutorial>
      </section>

      <section>
        <head>Changing attributes: Overview</head>
        <slide>
          <p>Several ways for elements to possess attributes: <list>
          <item>By being a member of an attribute class</item>
          <item>By having attributes privately</item>
        </list>
          </p>
          <p>Hence, several ways to remove attributes from elements: <list>
          <item>By deleting the attribute class from the schema altogether</item>
          <item>By deleting the attribute from the attribute class</item>
          <item>By unsubscribing the element from that attribute class</item>
          <item>By removing a privately held attribute from the element that owns it</item>
        </list>
          </p>
        </slide>
        <lectureNote>
          <p>So far we've learned how to include modules and include
          or exclude elements. How about if we want to change or
          remove an attribute? Let's focus first on removing
          attributes.</p>
          <p>Remember that elements get attributes by belonging to an
          attribute class: because <gi>div</gi> is in the attribute
          class <code>att.typed</code>, it gets the <att>type</att>
          and <att>subtype</att> attributes (just like all members of
          that attribute class: <gi>persName</gi>, <gi>head</gi>,
          <gi>note</gi>, and a whole bunch of other elements)</p>
          <p>And elements can also have attributes privately: these
          are attributes that belong to that element alone, rather
          than being part of a class. E.g., <gi>handShift</gi> has its
          <att>new</att> attribute, and <gi>relation</gi> has its
          <att>mutual</att> attribute.</p>
          <p>Hence there are a few different ways to remove an
          attribute:
          <list>
            <item>To remove it from the entire schema, you can either
            <list>
              <item>delete the entire attribute class from the
              schema. This of course deletes <emph>all</emph> the
              attributes that are members of that class. E.g., if
              you never plan to use either the <att>full</att> or
              the <att>sort</att> attribute on your names, you might
              delete the <name type="class">att.personal</name>
              class from your schema. OR</item>
              <item>delete the attribute from the attribute class it
              belongs to. In this case, no element in the schema
              will have that attribute, but the others in the class
              will survive. So if you think the <att>subtype</att>
              attribute is evil and unnecessary, you might want to
              delete it from the <name type="class"
              >att.typed</name> class, thus leaving the
              ever-important <att>type</att> attribute</item>
            </list>
            </item>
            <item>To remove an attribute from a single element, if
            the element has that attribute because of class
            membership, you can remove the element from that
            attribute class; that way the other elements that
            subscribe to that attribute class won't be affected. So
            if you want to use <att>subtype</att> on <gi>div</gi>,
            but not on <gi>head</gi>, you would just want to remove
            it from <gi>head</gi> and leave <gi>div</gi> unchanged.
            (But note the gotcha in a moment...)</item>
            <item>To remove an attribute from a single element, if
            that element is a <soCalled>private owner</soCalled> of
            that attribute, you can just change the definition of
            that specific element to remove the attribute.</item>
          </list>
          </p>
          <p>We'll illustrate all of these in the next slide. First,
          the gotcha: when you unsubscribe an element from an
          attribute class, it loses <emph>all</emph> the attributes
          that it gets from that class. So in our example, if we
          remove <gi>head</gi> from the <code>att.typed</code> class,
          what will happen? (It will lose both <att>type</att> and
          <att>subtype</att>, which isn't really what we want.) The
          solution is that you have to remove the element from the
          class, and then restore any individual attributes you want
          it to retain. We'll show that in a second. </p>
        </lectureNote>
        <tutorial>
          <p>So far we've learned how to include modules and include
          or exclude elements. How about if we want to change or
          remove an attribute? Let's focus first on removing
          attributes.</p>
          <p>Elements get attributes by belonging to an attribute
          class. So, for example, because <gi>div</gi> is in the
          attribute class att.typed, it gets the type and subtype
          attributes (just like all members of that attribute class:
          persName, head, note, and a whole bunch of other
          elements).</p>
          <p>And elements can also have attributes privately. These
          are attributes that belong to that element alone, rather
          than being part of a class. For example, <gi>handShift</gi>
          has its <att>new</att> attribute, and <gi>relation</gi> has
          its <att>mutual</att> attribute.</p>
          <p>Hence there are a few different ways to remove an
          attribute. To remove it from the entire schema, you can
          either delete the entire attribute class from the schema or
          delete the attribute from the attribute class it belongs to.
          If you delete an entire attribute class, this of course
          deletes <emph>all</emph> the attributes that are members of
          that class. So, if you never plan to use either the full or
          the sort attribute on your names, you might delete the
          att.personal class from your schema.</p>
          <p>If you delete the attribute from the class it belongs to,
          no element in the schema will have that attribute, but the
          others in the class will survive. So if you think the
          subtype attribute is evil and unnecessary, you might want to
          delete it from the att.typed class, thus leaving the
          ever-important type attribute.</p>
          <p>To remove an attribute from a single element, you can
          remove the element from that attribute class (note that this
          is for attributes that are a part of attribute classes, not
          single attributes associated with only one element). This
          way the other elements that subscribe to that attribute
          class won't be affected. So if you want to use subtype on
          <gi>div</gi>, but not on <gi>head</gi>, you would just want
          to remove it from <gi>head</gi> and leave <gi>div</gi>
          unchanged. However, when you unsubscribe an element from an
          attribute class, it loses all the attributes that it gets
          from that class. So in our example, if we remove
          <gi>head</gi> from the att.typed class, what will happen?
          (It will lose both type and subtype, which isn't really what
          we want.) The solution is that you have to remove the
          element from the class, and then restore any individual
          attributes you want it to retain. We'll show that in a
          second.</p>
          <p>To remove an attribute from a single element, if that
          element is a private owner of that attribute, you can just
          change the definition of that specific element to remove the
          attribute.</p>
          <p>We'll illustrate all of these customizations in the next
          slide.</p>
        </tutorial>
      </section>

      <section>
        <head>Changing attributes: Examples</head>
        <slide>
          <p>To delete an entire attribute class from the schema (scorched earth approach):</p>
          <egMarkup scheme="TEI" type="valid">
            <classSpec type="atts" ident="att.personal" mode="delete"/>
          </egMarkup>

          <p>To delete a single attribute from an attribute class (selective thinning):</p>
          <egMarkup scheme="TEI" type="valid">
            <classRef key="att.global" except="xml:base xml:space"/>
          </egMarkup>
          <!-- p>OR</p>
               <eg><![CDATA[<classSpec type="atts" ident="att.global" mode="change">
               <attList>
               <attDef ident="xml:space" mode="delete"/>
               <attDef ident="xml:base" mode="delete"/>
               </attList>
               </classSpec>]]></eg -->

          <p>To unsubscribe an element from an attribute class (genteel bureaucratic approach):</p>
          <egMarkup scheme="TEI" type="valid">
            <elementSpec module="core" ident="pb" mode="change">
              <classes mode="change">
                <memberOf key="att.typed" mode="delete"/>
              </classes>
            </elementSpec>
          </egMarkup>

          <p>To remove a specific attribute from an element that holds it privately
          (repossession):</p>
          <egMarkup scheme="TEI" type="valid">
            <elementSpec module="core" ident="note" mode="change">
              <attList>
                <attDef ident="anchored" mode="delete"/>
              </attList>
            </elementSpec>
          </egMarkup>
        </slide>
        <tutorial>
          <p>Here are some examples of how to change attributes, spend some time going through them
          to familiarize yourself with the syntax.</p>
        </tutorial>
      </section>

      <section>
        <head>The <att>mode</att> attribute</head>
        <slide>
          <p>The <att>mode</att> attribute is used on most schema specification elements and has
          four possible values: <list>
          <item><code>mode="delete"</code>: delete this feature</item>
          <item><code>mode="add"</code>: add this new feature</item>
          <item><code>mode="change"</code>: change just the parts of this feature that I am
          specifying here</item>
          <item><code>mode="replace"</code>: replace this feature completely with my
          version</item>
        </list>
          </p>
          <p>When in doubt, use it!</p>
        </slide>
        <lectureNote>
          <p>We've now seen a few more examples of the <att>mode</att> attribute and it's worth
          pausing for a second to pay closer attention to it. You can use it on almost all of the
          schema specification elements we're looking at, and even though they're valid without
          it, a processor may not process your ODD properly if it's not present. So you should get
          in the habit of using it.</p>
          <p>It has four possible values: <list>
          <item><code>mode="delete"</code>: delete this feature</item>
          <item><code>mode="add"</code>: add this new feature</item>
          <item><code>mode="change"</code>: change just the parts of this feature that I am
          specifying here</item>
          <item><code>mode="replace"</code>: replace this feature completely with my
          version</item>
        </list>
      </p>
    </lectureNote>
    <tutorial>
      <p>We've now seen a few examples of the mode attribute and it's worth pausing for a second
      to pay closer attention to it. You can use it on almost all of the schema specification
      elements we're covering in this tutorial. Even though they're valid without it, a
      processor may not process your ODD properly if it's not present, so you should get in
      the habit of using it.</p>
      <list>
        <head>It has several possible values:</head>
        <item><code>mode="delete"</code>: delete this feature</item>
        <item><code>mode="add"</code>: add this new feature</item>
        <item><code>mode="change"</code>: change just the parts of this feature that I am
        specifying here</item>
        <item><code>mode="replace"</code>: replace this feature completely with my
        version</item>
      </list>
      <p>It is important to understand the differences between the <val>change</val> and
      <val>replace</val> values, because, although they seem very similar, they are just
      different enough to cause you problems. If there is anything that you want to keep from
      the TEI's definition of the element/attribute/value, use the <val>change</val>
      value.</p>
    </tutorial>
  </section>

  <section>
    <head>Changing attributes: Specifying values</head>
    <slide>
      <p>To constrain the values for an attribute:</p>
      <egMarkup scheme="TEI" type="valid">
        <elementSpec ident="title" mode="change" module="core">
          <attList>
            <attDef ident="type" mode="replace">
              <datatype>
                <dataRef key="teidata.enumerated"/>
              </datatype>
              <valList type="closed">
                <valItem ident="LP"/>
                <valItem ident="single"/>
                <valItem ident="eightTrack"/>
                <valItem ident="cassette"/>
                <valItem ident="CD"/>
                <valItem ident="VCRtape"/>
                <valItem ident="DVD"/>
                <valItem ident="blueRay"/>
              </valList>
            </attDef>
          </attList>
        </elementSpec>
      </egMarkup>
    </slide>
    <lectureNote>
      <p>OK, let's walk through this one together...</p>
      <p>First, what are these new elements doing? Figure it out based on what we've already
      seen...</p>
      <p>What's a data type? A way of constraining what kinds of data are valid in this space:
      for instance, requiring that a number consist of integers only, or that a date conform
      to a specific format. In this case, we're saying that the contents of the
      <att>type</att> attribute must be from a controlled list that we specify; the datatype
      <code>data.enumerated</code> is one that the TEI has defined for us, and this is the
          mechanism for referencing it.</p>
          <p>We'll deal with data types in more detail a bit later in the workshop.</p>
          <p>The <gi>valList</gi> contains the possible values; <att>type</att> indicates whether
          the list is closed (no other values permitted) or semi-closed (these values will show up
          in a menu but others are permitted) or open (the values given are suggestions only).</p>
          <p>If the attribute already exists use <code>mode="change"</code> on <gi>attDef</gi>; if
          this is a new attribute, use <code>mode="add"</code>.</p>
          <p>Let's try this out in practice...</p>
</lectureNote>
<tutorial>
  <p>First, what are these new elements doing? Let's take a look at the new elements here
  and talk about what them.</p>
  <p><gi>elementSpec</gi> is stating that the TEI element being referred to is
  <gi>title</gi> (which is in the core module). It is further stating that this element
  is being changed (rather than added, deleted, or replaced).</p>
  <p>We then state that we are referring to the different attibutes on <gi>title</gi>, using
  the <gi>attList</gi> element. The <gi>attDef</gi> element is referring to one specific
  attribute (<att>type</att>), and stating that it is replacing it's TEI definition with a
  different definition.</p>
  <p>A datatype is a way of constraining what kinds of data are valid in this space. For
  instance, requiring that a number consist of integers only, or that a date conform to a
  specific format. In this case, we're saying that the contents of the type attribute must
  be from a controlled list that we specify; the datatype data.enumerated is one that the
  TEI has defined for us, and this is the mechanism for referencing it. We'll deal with
  datatypes in more detail in the next slide.</p>
  <p>The <gi>valList</gi> contains the possible values; <att>type</att> indicates whether
  the <gi>valList</gi> is closed (no other values permitted), semi-closed (these values
  will show up in a menu but others are permitted), or open (the values given are
  suggestions only).</p>
  <p>If the attribute already exists use <code>mode="change"</code> on <gi>attDef</gi>; if
  this is a new attribute, use <code>mode="add"</code>.</p>
</tutorial>
</section>

<section>
  <head>Datatypes</head>
  <slide>
    <p>
      <emph>Datatype</emph>: <cit>
      <quote>a classification or category of various types of data, that states the possible
      values that can be taken, how they are stored, and what range of operations are
      allowed on them</quote>
      <ref target="http://en.wiktionary.org/wiki/data_type">Wictionary</ref>
    </cit>
  </p>
  <p>Datatypes have syntactic significance:</p>
  <list>
    <item>Is <val>http:/tei.wwp.northeastern.edu/</val> a valid value?</item>
    <item>How about <val>401-863-38</val>?</item>
    <item>Is <val>here there everywhere</val> one <soCalled>thing</soCalled> or
    three?</item>
  </list>
  <p>They also have semantic significance:</p>
  <list>
    <item>Does <formula>1 = 01</formula>?</item>
    <item>Or does <val>1</val> mean <mentioned>male</mentioned>?</item>
    <item>Does <formula>2012-06-05 = 2001</formula>, or is <val>2012-06-05</val> the date of the last transit of Venus?</item>
  </list>
</slide>
<lectureNote>
  <p>The TEI's use of the term probably doesn't precisely fit this definition, but it's
  close enough for our purposes</p>
  <p>Datatypes have syntactic significance: they affect how we <emph>parse</emph> and
  interpret the <emph>structure</emph> of a data value</p>
  <p>Datatypes also can have semantic significance: they affect how we understand the
  <emph>meaning</emph> of a data value</p>
  <p>What are some examples of attribute values that you might want to constrain using a
  datatype? (Use these to introduce other datatypes as needed.)</p>
  <p>We can test for syntactic validity, and perhaps even if values make sense (like
  birthdate preceding date of death); but we generally cannot test for semantic
  correctness. It is usually very easy to test general syntactic validity, but somewhat
  harder to be precise about allowed values. E.g., 90210 is a syntactically valid and
  semanticly useful ZIP code; 90910 is syntactically valid, but meaningless (there is no
  "909" USPO sectional center facility). In this case, testing that a ZIP code is 5 digits
  is very easy, but testing that it actually matches an existing post office is somewhat
  harder.</p>
</lectureNote>
<tutorial>
  <p>We saw datatypes come up in the previous slide when defining the list of possible
  values for the <att>type</att> attribute of the <gi>title</gi> element. It is important
  to note that datatypes have syntactic significance: they affect how we
  <emph>parse</emph> and interpret the <emph>structure</emph> of a data value. Datatypes
  also can have semantic significance: they affect how we understand the
  <emph>meaning</emph> of a data value.</p>
  <p>What are some examples of attribute values that you might want to constrain using a
  datatype?</p>
  <p>We can test for syntactic validity, and perhaps even if values make sense (like
  birthdate preceding date of death); but we generally cannot test for semantic
  correctness. It is usually very easy to test general syntactic validity, but somewhat
  harder to be precise about allowed values. E.g., 90210 is a syntactically valid and
  semantically useful ZIP code; 90910 is syntactically valid, but meaningless (there is no
  "909" USPO sectional center facility). In this case, testing that a ZIP code is 5 digits
  is very easy, but testing that it actually matches an existing post office is somewhat
harder.</p>
</tutorial>
</section>

<section>
<head>The Transit of Venus</head>
<slide>
  <figure rend="center">
    <graphic width="80%" url="../../../_utils/gfx/2012-06-05T15%3A13%3A23_modified.jpg"/>
    <figDesc>Photo of the DHSI 2012 XSLT class watching the transit of Venus outside
Clearihue Hall.</figDesc>
</figure>
</slide>
<tutorial>
  <p>At our XSLT workshop in 2012 we took a break to watch the
  transif of Venus. This is a very long slide set, so we added
  this just for fun! Feel free to take a break at this point.
  Or you can go back and review everything we've covered thus
far.</p>
</tutorial>
</section>

<section>
<head>The bigger picture …</head>
<slide>
  <egMarkup scheme="TEI" type="valid" xmldecl="true">
    <?xml-model href="http://www.wwp.northeastern.edu/outreach/seminars/_current/handouts/ODD_exercise/schemas/odd4odds.rnc" type="application/relax-ng-compact-syntax"?>
    <?xml-model href="http://www.wwp.northeastern.edu/outreach/seminars/_current/handouts/ODD_exercise/schemas/odd4odds.isosch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
    <TEI xmlns="http://www.tei-c.org/ns/1.0" xml:lang="en">
      <teiHeader>
        <fileDesc>
          <!-- metadata about your ODD file -->
        </fileDesc>
        <revisionDesc>
          <!-- change log is always a good idea -->
        </revisionDesc>
      </teiHeader>
      <text>
        <body>
          <p><!-- description of the schema --></p>
          <!-- more prose documentation -->
          <schemaSpec ident="test" targetLang="en">
            <!-- actual customization stuff -->
          </schemaSpec>
        </body>
      </text>
    </TEI>
  </egMarkup>
</slide>
<lectureNote>
  <p>Show <gi>SchemaSpec</gi> in context of entire TEI file, point out the various parts of
the ODD</p>
</lectureNote>
<tutorial>
  <p>Here is a view of the basic layout of your ODD file. Just like in any TEI file, you
  will have a TEI header, in which you can put the metadata about your ODD. We also
  recommend that you include a change log in your <gi>teiHeader</gi> so that you can keep
track of any revisions you make. This step is important for project documentation!</p>
<p>The <gi>body</gi> of your ODD can contain the element <gi>p</gi>, which you can use to
provide a prose description of your schema. The <gi>body</gi> also contains
<gi>schemaSpec</gi>, which is where you put all of the schema specifications we've
discussed so far.</p>
</tutorial>
</section>

<section>
  <head>A little review …</head>
  <slide>
    <p>Match up the actions on the left with the correct encoding snippet on the right (hint:
    sometimes the snippet won't tell the whole story):</p>
    <table>
      <row>
        <cell>Delete an element from the schema</cell>
        <cell>
          <egMarkup scheme="TEI" type="valid">
            <moduleRef key="namesdates"/>
          </egMarkup>
        </cell>
      </row>
      <row>
        <cell>Constrain attribute values</cell>
        <cell>
          <egMarkup scheme="TEI" type="valid">
            <attDef ident="type" mode="delete"/>
          </egMarkup>
        </cell>
      </row>
      <row>
        <cell>Delete an attribute</cell>
        <cell>
          <egMarkup scheme="TEI" type="valid">
            <classSpec type="atts" ident="att.naming" mode="delete"/>
          </egMarkup>
        </cell>
      </row>
      <row>
        <cell>Include a module in the schema</cell>
        <cell>
          <egMarkup scheme="TEI" type="valid">
            <attDef ident="rendition" mode="change"> <!-- ... --> </attDef>
          </egMarkup>
        </cell>
      </row>
      <row>
        <cell>Delete an attribute class</cell>
        <cell>
          <egMarkup scheme="TEI" type="valid">
            <elementSpec module="namesdates" ident="addName" mode="delete"/>
          </egMarkup>
        </cell>
      </row>
    </table>
</slide>
<tutorial>
  <p>Now that we've gotten this far, let's do a quick review of the elements we've learned
  up to this point. Match up the ODD customizations with their corresponding elements, and
check your answers against the explanations below.</p>
<p>In order to delete an element for the schema, you would use <tag>elementSpec
mode="delete"/</tag>, specifying the <code>module=""</code> and element name (with
<code>ident=""</code>). In this case the <gi>addName</gi> element from the namesdates
module was deleted. You can also delete elements with the exclude= attribute on
<tag>moduleRef /</tag></p>
<p>This next one's a bit tricky, since we don't have all of the necessary information. If
we wanted to constrain attribute values, we would need to use the <gi>attDef</gi>
element. As you can see, there are two possible answers. Now we need to look at the
attribute values to give us a hint as to what the element is doing. Specifically, we
want to look at the mode= attribute. Since we want to specify values, what we are doing
is changing the definition of the attribute. So, in this case, we would use <tag>attDef
ident="rendition" mode="change" /</tag>.</p>
<p>In order to delete an attribute, we would use the other example of <gi>attDef</gi> -
<tag>attDef ident="type" mode="delete" /</tag></p>
<p>In order to include a module in the schema, we would use <tag>moduleRef
key="namesdates" /</tag> (with the value of <att>key</att> being the name of the
module we want to include).</p>
<p>In order to delete a whole attribute class, we would use <tag>classSpec type="atts"
ident="att.naming" mode="delete" /</tag></p>
</tutorial>
</section>

<section>
<head>A view of the whole system</head>
<slide>
  <figure>
    <graphic height="600px" url="../../../_utils/gfx/odd_stack.png"/>
</figure>
</slide>
<tutorial>
  <p>The TEI is based off a bunch of source ODD files. These generate all of the TEI schemas
  and the TEI documentation for the tei-c website. Syd Bauman (of the WWP) has also
  created ODD customizations specifically for writing ODDs. The schemas generated from
Syd's ODD are customizations of those original TEI ODDs.</p>
<p>The schemas generated from Syd's customizations (odds4odds) are used to validate your
ODD files. When you generate your schema, you also are taking information from the TEI
source ODDs. Your customization is then used to validate your files.</p>
<p>This information is not necessary to your understanding of the ODD customization
process, but it's good to know if you are interested in the backend of the TEI.</p>
</tutorial>
</section>

<section>
<head>Tour and Try</head>
<slide>
<p><ref target="../../demos/ODDs/imls_tight.odd">Sample ODD</ref></p>
<p><ref target="../../handouts/ODD_exercise/odd_extended_template.xml">Template ODD
(extended)</ref></p>
<p><ref target="../../handouts/ODD_exercise/odd_quickstart_template.xml">Template ODD
(quick-start)</ref></p>
</slide>
<lectureNote>
  <p>Show a commented, well-organized ODD with each set of customization components grouped
together neatly</p>
</lectureNote>
<tutorial>
  <p>Take this moment to try some of your own ODD writing skills, using the attached sample
ODD files.</p>
</tutorial>
</section>

<section>
<head>Inventory of our skills thus far</head>
<slide>
  <p>Here are the basic customization tasks we now know how to do: <list>
<item>Including modules</item>
<item>Trimming down modules by deleting elements</item>
<item>Changing our attributes</item>
</list>
</p>
<p>Some more challenging things we're going to cover next: <list>
<item>Deleting entire classes of elements</item>
<item>Adding new elements to our schema</item>
</list>
</p>
</slide>
<tutorial>
  <p>So far, we've gone over the basics of TEI customization. These concepts are going to be
  important for the next few slides, so take a look at these topics to make sure that you
  have a grasp of them. If there's something you aren't sure you fully understand, take a
  moment to go back and review. Now we're going to move on to some more advanced
topics.</p>
</tutorial>
</section>

<section>
  <head>Deleting model classes</head>
  <slide>
    <figure>
      <graphic url="../../../_utils/gfx/tei_classes_conceptual4.png"/>
    </figure>
  </slide>
  <lectureNote>
    <p>We've become familiar with an approach to customization that emphasizes the modules and
    the individual elements, and you've all had practice in constraining your data in this
    way: <list>
    <item>in deleting entire modules, based on whether you need the elements that have to
    do with a specific genre or type of markup</item>
    <item>in deleting individual elements, based on whether you want to use a specific
    element or not</item>
    </list> Now we're going to take a look at another way of approaching constraint: by
    deleting <emph>classes</emph> of elements, based on whether you need the elements that
    perform a certain kind of function in the text, or occupy a certain kind of space within
    the text.</p>
    <p>Let's come back to the slide we saw earlier, showing how model classes represent
    functional groupings of elements.</p>
    <p>What if we didn't want to represent any kind of milestones in our document--no page
    breaks, no column breaks, no line breaks, no page numbers or other kinds of forme work,
    no anchors? These elements come from three different modules, one of which is the core
    module, so we can't delete them all just by excluding a module. If we want to delete
    them <emph>as a group</emph> and make it easy to represent that deletion as a single
    functional decision, we need to delete the model class that contains them.</p>
  </lectureNote>
  <tutorial>
    <p>We've become familiar with an approach to customization that emphasizes the modules and
    the individual elements, and you've all had practice in constraining your data in this
    way—in deleting entire modules, based on whether you need the elements that have to do
    with a specific genre or type of markup, and in deleting individual elements, based on
    whether you want to use a specific element or not.</p>
    <p>Now we're going to take a look at another way of approaching constraint: by deleting
    classes of elements, based on whether you need the elements that perform a certain kind
    of function in the text, or occupy a certain kind of space within the text.</p>
    <p>Let's come back to the slide we saw earlier, showing how model classes represent
    functional groupings of elements.</p>
    <p>What if we didn't want to represent any kind of milestones in our document—no page
    breaks, no column breaks, no line breaks, no page numbers or other kinds of forme work,
    no anchors? These elements come from three different modules, one of which is the core
    module, so we can't delete them all just by excluding a module. If we want to delete
    them as a group and make it easy to represent that deletion as a single functional
    decision, we need to delete the model class that contains them.</p>
  </tutorial>
</section>

<section>
  <head>Deleting model classes: example</head>
  <slide>
    <egMarkup scheme="TEI" type="valid">
      <classSpec ident="model.milestoneLike"  mode="delete" type="model"/>
    </egMarkup>
  </slide>
  <tutorial>
    <p>Here is the example discussed on the previous slide. This would delete the model class
    "milestoneLike" which includes those elements that act like milestones
    (<gi>milestone</gi>, <gi>pb</gi>, <gi>gb</gi>, <gi>fw</gi>, <gi>anchor</gi>).</p>
  </tutorial>
</section>

<section>
  <head>Adding an element</head>
  <slide>
    <list>
      <item>pick a name (including namespace!)</item>
      <item>gloss the name, if needed</item>
      <item>provide a short prose description</item>
      <item>decide where it goes <list>
      <item>in same places as existing TEI elements, add it to the proper class</item>
      <item>in particular places, have to alter the containing elements'
      <gi>content</gi></item>
      </list></item>
      <item>does it get any attributes via classes?</item>
      <item>decide on its content</item>
      <item>does it need any other attributes?</item>
      <item>perhaps provide examples</item>
      <item>provide further prose discussion</item>
    </list>
    <p>Let's do an actual example...</p>
  </slide>
  <tutorial>
    <p>There are a lot of important pieces that are involved in creating an element, many of
    which you have seen now that you've learned how to change pre-existing TEI elements. Now
    you get to put them all together in order to create you own custom element!</p>
    <p>In order to add an element you will first need to come up with a name for the element.
    You will probably want to come up with a name that is related to the concept your
    element is trying to capture. You also will probably want to make the element name
    something other than a name the TEI already uses. This is not necessary, since you will
    need to include the namespace (which differentiates between the elements you make and
    those the TEI has already defined). However, if you avoid doubling up on TEI names, it
    will make your life easier.</p>
    <p>If your element name is not immediately understandable, you may want to provide a gloss
    for the element, explaining what it is capturing. For example, the WWP created the
    <gi>mcr</gi> element to capture <q>meaningful change in rendition.</q> We provided a
    gloss so that our encoders and audience know what <gi>mcr</gi> stands for. You will also
    want to provide a prose description of your element.</p>
    <p>Then you will need to specify where the element can go. The easiest way to do this is
    find similar elements, or elements that would be a part of the same model class. You can
    then subscribe your new element to this model class. So, for example, if you are marking
    up official seals that always come at the end of documents, you could make you new
    element <gi>officialSeal</gi> a part of model.divBottomPart. However, if there is no
    model class that works well, you will need to decide which elements your new element
    needs to go inside. You will then need to modify the <gi>content</gi> of those elements
    in order to allow your new element to go inside.</p>
    <p>You will also decide which attribute classes to subscribe it to. Does it need
    <att>type</att> and <att>subtype</att>? Does it need to be dated with <att>when</att>
    or other related attributes? You will need to subscribe your new element to attribute
    classes based on the data you want to collect. It is also worth noting that you should
    subscribe all new elements to model.global and att.global, since all TEI elements are
    subscribed to these classes.</p>
    <p>You will then need to decide what can go inside the element. If it is a chunk-level
    element that functions similarly to <gi>p</gi>, you will probably want something like
    macro.paraContent, which includes most phrase-level elements as well as text. However,
    if you have a smaller, phrase-level element, you'll probably only want text and a few
    choice elements.</p>
    <p>You can also create new attributes for the specific element. These attributes can have
    specified values, as we discussed in the previous slides.</p>
    <p>You will also want to provide documentation for your element, including a prose
    description and some examples of how the element is used. More explanation of
    documentation practices is explained in the next slide set.</p>
    <p>This sounds like a lot, so let's look at an example.</p>
  </tutorial>
</section>

<section>
  <head>Added element</head>
  <slide>
    <egMarkup scheme="TEI" type="valid">
      <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 yaps:xmlns="http://www.tei-c.org/ns/Examples" xmlns:mimp="http://www.MYINSTITUTION.edu/MYPROJECT/ns/1.0">
            <mimp:airport type="municipal" sortKey="KMLI" runway="5/23"
                          yaps:xmlns..mimp="http://www.MYINSTITUTION.edu/MYPROJECT/ns/1.0">
              <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>
    </egMarkup>
  </slide>
  <tutorial>
    <p>In this example, we are adding the element <gi>airport</gi> to our schema. It is a
    member of model.placeLike, so it fits in the same places that <gi>place</gi> 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 <att>sortKey</att>).</p>
    <p>The <gi>content</gi> element provides us with information about what <gi>airport</gi>
    can contain. Here we see it must include at least one <gi>name</gi> element, any number
    of things from model.descLike, and the <gi>location</gi> element.</p>
    <p>It also contains an attribute <att>runway</att>, which is required and can occur only
    once. The <gi>constraintSpec</gi> element contains an isoschematron specification for
    what content is allowed as a value of <att>runway</att>. (we will discuss schematron
    later in the tutorial).</p>
    <p>There is then an example of how to use <gi>airport</gi> within an xml document, as well
    as remarks on how the element should be used.</p>
  </tutorial>
</section>

<section>
  <head>Namespaces — meaning</head>
  <slide>
    <table rend="class( bordered )">
      <row role="label">
        <cell>Genus name</cell>
        <cell>Species name</cell>
        <cell>commonly</cell>
      </row>
      <row>
        <cell>Homo</cell>
        <cell>sapiens</cell>
        <cell>human</cell>
      </row>
      <row>
        <cell>Picea</cell>
        <cell>glauca</cell>
        <cell>white spruce</cell>
      </row>
      <row>
        <cell>Agoseris</cell>
        <cell>glauca</cell>
        <cell>prairie agoseris</cell>
      </row>
      <row>
        <cell>Pilosocereus</cell>
        <cell>leucocephalus</cell>
        <cell>a fuzzy cactus with a pretty pink/red flower</cell>
      </row>
      <row>
        <cell>Haliaeetus</cell>
        <cell>leucocephalus</cell>
        <cell>bald eagle</cell>
      </row>
      <row>
        <cell>TEI</cell>
        <cell><gi>head</gi></cell>
        <cell>a heading, e.g. of a chapter</cell>
      </row>
      <row>
        <cell>HTML</cell>
        <cell><gi>head</gi></cell>
        <cell>container for metadata</cell>
      </row>
      <row>
        <cell>TEI</cell>
        <cell><gi>constraint</gi></cell>
        <cell>a formal constraint (e.g., in ISO Schematron) not expressed in the structural
        content model</cell>
      </row>
      <row>
        <cell>DocBook</cell>
        <cell><gi>constraint</gi></cell>
        <cell>a constraint in an EBNF production</cell>
      </row>
    </table>
  </slide>
  <lectureNote>
    <p>When you look at an element (for instance in TEI), you see its name: every element has
    a name (e.g. <name>div</name> or <name>p</name>). </p>
    <p>What may be less obvious is that this name is only part of its full, formal
    designation. What we're seeing when we look at an XML element, typically, is like a
    species name (for instance, <q>glauca</q>). We can see from these examples that many
    creatures may have the same species name: what makes the name unique is the combination
    of the genus and species names.</p>
    <p>In a very similar way, XML elements have both genus and species names. In the example
    here, we're only seeing the species name, and in fact we can't tell by looking at this
    slide what the real element names are: we don't know what language they're in (TEI?
    HTML?) In order to know what language an element is in, we need both. That's where
    namespaces come in.</p>
  </lectureNote>
  <tutorial>
    <p>When you look at an element (for instance in TEI), you see its name: every element has
    a name (e.g. div or p). What may be less obvious is that this name is only part of its
    full, formal designation. What we're seeing when we look at an XML element, typically,
    is like a species name (for instance, glauca). We can see from these examples that many
    creatures may have the same species name: what makes the name unique is the combination
    of the genus and species names.</p>
    <p>In a very similar way, XML elements have both genus and species names. In the example
    here, we're only seeing the species name, and in fact we can't tell by looking at this
    slide what the real element names are: we don't know what language they're in (TEI?
    HTML?) In order to know what language an element is in, we need both. That's where
    namespaces come in.</p>
  </tutorial>
</section>

<section>
  <head>Namespaces — syntax</head>
  <slide>
    <!-- figure>
      <graphic height="795px" width="690px" url="../../../_utils/gfx/namespaces2.png"/>
    </figure>
    For years we used the above <figure> instead of the below
    <egMarkup>s. The advantages of <egMarkup> is obvious — the output
    is text, so you can search, select, & resize easily. The advantage
    of the <figure> is that the image has different colors for non-default
    namespace declarations. But since it mis-colors default namespace
    declarations, I am inclined to use the new <egMarkup>s, myself.
    Even better if I would get off my keester and write code so that
    namespace declarations were colored properly by <egMarkup>. Sigh.
    — Syd, 2026-05-24 -->
    <list rend="ordered" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:syd="http://bauman.zapto.org/~syd/XML-xmp-ns">
      <item>
        <egMarkup scheme="ad-hoc" type="well-formed">
          <intro yaps:xmlns="http://bauman.zapto.org/~syd/XML-xmp-ns">
            <greeting yaps:xmlns="http://bauman.zapto.org/~syd/XML-xmp-ns">
              <w yaps:xmlns="http://www.tei-c.org/ns/1.0">Hello</w>
              <w yaps:xmlns="http://www.tei-c.org/ns/1.0">World</w>
              <pc yaps:xmlns="http://www.tei-c.org/ns/1.0">!</pc>
            </greeting>
          </intro>
        </egMarkup>
      </item>
      <item>
        <egMarkup scheme="ad-hoc" type="well-formed">
          <syd:intro yaps:xmlns..syd="http://bauman.zapto.org/~syd/XML-xmp-ns" yaps:xmlns..tei="http://www.tei-c.org/ns/1.0">
            <syd:greeting>
              <tei:w>Hello</tei:w>
              <tei:w>World</tei:w>
              <tei:pc>!</tei:pc>
            </syd:greeting>
          </syd:intro>
        </egMarkup>
      </item>
      <item>
        <egMarkup scheme="ad-hoc" type="well-formed">
          <syd:intro yaps:xmlns..syd="http://bauman.zapto.org/~syd/XML-xmp-ns" yaps:xmlns="http://www.tei-c.org/ns/1.0">
            <syd:greeting>
              <w>Hello</w>
              <w>World</w>
              <pc>!</pc>
            </syd:greeting>
          </syd:intro>
        </egMarkup>
      </item>
      <item>
        <egMarkup scheme="ad-hoc" type="well-formed">
          <intro yaps:xmlns="http://bauman.zapto.org/~syd/XML-xmp-ns" yaps:xmlns..tei="http://www.tei-c.org/ns/1.0">
            <greeting>
              <tei:w>Hello</tei:w>
              <tei:w>World</tei:w>
              <tei:pc>!</tei:pc>
            </greeting>
          </intro>
        </egMarkup>
      </item>
      <item>
        <egMarkup scheme="TEI" type="well-formed">
          <TEI yaps:xmlns="http://www.tei-c.org/ns/1.0">
            <!-- ... -->
          </TEI>
        </egMarkup>
      </item>
    </list>
  </slide>
  <lectureNote>
    <p>Namespaces are in effect the <soCalled>genus</soCalled> name for an XML element. If
    you're operating colloquially within a single genus (your whole document is in TEI, for
    instance), then you can get away with only giving the species name. But if you're
    actually processing documents with software, you always need to specify both. So how do
    we do this?</p>
  </lectureNote>
  <tutorial>
    <p>Namespaces are in effect the genus name for an XML element. If you're operating
    colloquially within a single genus (your whole document is in TEI, for instance), then
    you can get away with only giving the species name. But if you're actually processing
    documents with software, you always need to specify both. So how do we do this?</p>
    <p>The first example shows us how to specify the namespace on every element as it occurs.
    In this case, you use the <att>xmlns</att> attribute, whose content is your namespace
    (which is always a url). This is very bulky, however, and probably will make your
    document harder to read. So we can specify two different namespaces at the top of our
    document, as you can see in the second example.</p>
    <p>At the top of your document, you can specify the tei:xmlns and the xmlns you created
    (in this case syd:xmlns). Then, whenever you use an element, you just need to use the
    tei: or syd: prefixes to specify the namespace. The third example shows you how to
    specify one namespace as the default and the alternate namespace as the one with the
    prefix. This way, you only need to use a prefix for one set of elements. The final
    example is the TEI namespace declaration that is used on most TEI documents.</p>
  </tutorial>
</section>

<section>
  <head>Content models: quantification</head>
  <slide>
    <p>What is allowed inside an element?</p>
    <egMarkup scheme="TEI" type="valid">
      <content>
        
        <!-- 1 <head>: -->
        <elementRef key="head"/>
        
        <!-- 0 or 1 <label> (i.e., optional): -->
        <elementRef key="label" minOccurs="0" maxOccurs="1"/>
        
        <!-- 1 to 5 <gloss>s: -->
        <elementRef key="gloss" minOccurs="1" maxOccurs="5"/>
        
        <!-- 1 or more <desc>s (i.e., repeatable): -->
        <elementRef key="desc" minOccurs="1" maxOccurs="unbounded"/>
        
        <!-- 0 or more <note>s (i.e., optional and repeatable): -->
        <elementRef key="note" minOccurs="0" maxOccurs="unbounded"/>
        
      </content>
    </egMarkup>
  </slide>
  <lectureNote>
    <p>Let's take a closer look at the part of the element specification where we define what
    the content of the element is. This definition makes use of a specialized vocabulary for
    referring to elements and controlling their behavior</p>
    <p>You can specify how many times an element can occur: optionally, one or more times, or
    zero or more times...</p>
  </lectureNote>
  <tutorial>
    <p>Let's take a closer look at the part of the element specification where we define what
    the content of the element is. This definition makes use of a specialized vocabulary for
    referring to elements and controlling their behavior.</p>
    <p>You can specify how many times an element can occur. You use the <att>minOccurs</att>
    and and <att>maxOccurs</att> attributes to specify how often a given element can occur
    inside of the one you're defining.</p>
    <!--<p>This used to be done using RELAX NG. If you wish to learn this syntax see our slide set on <ref>RELAX NG and ODD customization.</ref></p>-->
  </tutorial>
</section>

<section>
  <head>Content models: order?</head>
  <slide>
    <egMarkup scheme="TEI" type="valid">
      <content>
        <sequence>
          <elementRef key="head" minOccurs="0" maxOccurs="1"/>
          <alternate minOccurs="1" maxOccurs="unbounded">
            <elementRef key="p"/>
            <elementRef key="quote"/>
          </alternate>
          <alternate minOccurs="0" maxOccurs="unbounded">
            <elementRef key="bibl"/>
            <elementRef key="ref"/>
          </alternate>
        </sequence>
      </content>
    </egMarkup>
  </slide>
  <lectureNote>
    <p>We can also control the order in which elements will appear. By default, they appear in
    the order given</p>
    <p> So what if we want things to be allowed to appear in any order? We can nest
    <gi>rng:choice</gi> inside other RNG constructs, such as <gi>rng:oneOrMore</gi> or
    <gi>rng:zeroOrMore</gi>.</p>
    <p>Think through the logic from outside to inside: we are making one or more choices
    between <gi>p</gi> and <gi>quote</gi> inside our notes.</p>
    <p>Note that order still applies here: so the optional heading comes first, followed by
    our one or more choices between <gi>p</gi> and <gi>quote</gi>, followed by zero or more
    choices between <gi>bibl</gi> or <gi>ref</gi></p>
  </lectureNote>
  <tutorial>
    <p>We can also control the order in which elements will appear. By default, they appear in
    the order that they are listed in the ODD file.</p>
    <p>So what if we want things to be allowed to appear in any order? We can nest the TEI
    <gi>alternate</gi> other elements in the ODD. This means that any <gi>elementRef</gi>
    elements that occur within the <gi>alternate</gi> element can be placed in any
    order.</p>
    <p>Think through the logic from outside to inside: we are making our notes contain one or
    more paragraphs/quotes, followed by zero or more <gi>bibl</gi>/<gi>ref</gi>
    elements.</p>
    <p>Note that order still applies here: so the unlimited combination of <gi>p</gi> and
    <gi>quote</gi> elements is immediately followed by zero or more choices between
    <gi>bibl</gi> or <gi>ref</gi>. Once you have a <gi>bibl</gi> or a <gi>ref</gi>, you
    can't put any more quotes or paragraphs, according to this code snippet.</p>
  </tutorial>
</section>

<section>
  <head>Updated inventory of our skills thus far</head>
  <slide>
    <p>Here are the basic customization tasks we now know how to do: <list>
    <item>Including modules</item>
    <item>Trimming down modules by deleting elements</item>
    <item>Constraining our attribute values</item>
    <item>Deleting attributes and attribute classes</item>
    <item>Deleting entire classes of elements</item>
    <item>Adding new elements to our schema</item>
  </list>
    </p>
    <p>Some more challenging things we're not going to cover (but you should know about): <list>
    <item>Altering model classes: what elements belong to them, where they can go</item>
    <item>Including elements from other languages (EAD, MODS, SVG, ...) in your
    schema</item>
    <item>Changing the content models for specific elements</item>
    <item>Creating more nuanced content models using RELAX NG</item>
    <item>Creating additional constraints using Schematron</item>
    <item>Writing non-TEI languages using the ODD system</item>
  </list>
    </p>
    <p>And some things that are just plain impossible: <list>
    <item>Writing non-XML languages using the ODD language</item>
  </list>
    </p>
  </slide>
  <tutorial>
    <p>This slide contains an inventory of the customization skills and tasks convered thus
    far. If you are unfamiliar with any of these skills, refer back to this tutorial and the
    <ref target="../customization/customization_overview_tutorial_00.xhtml">Overview of
    Customization tutorial</ref>.</p>
    <list>
      <head>This tutorial is complete, please see links below to continue:</head>
      <item><ref target="../documentation/documentation_curation_odd_tutorial_00.xhtml"
                 >Proceed to next tutorial in TEI Customization Primer</ref></item>
      <item><ref target="../../../../resources/customization.html">Return to TEI Customization
      Primer</ref></item>
      <item><ref target="../../../../resources/tutorial_main.html">Return to main tutorial
      page</ref></item>
    </list>
  </tutorial>
</section>

</presentation>
</text>
</TEI>
