<?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: advanced_encoding.xml 51709 2026-05-28 23:29:13Z syd $ -->
<TEI xmlns="http://www.wwp.northeastern.edu/ns/yaps"
     xmlns:y="http://www.wwp.northeastern.edu/ns/yaps"
     xmlns:eg="http://www.tei-c.org/ns/Examples"
     >
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>Advanced Markup Concepts</title>
        <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-04"/>
        <availability status="restricted">
          <p>Copyright 2007 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>Covers parallel structures, linking, overlap. Based on editorial_markup and
          markup_challenges</p>
      </sourceDesc>
    </fileDesc>
    <revisionDesc>
      <change who="personography.xml#sstanley.fxj" when="2015-10-12"/>
      <change when="2013-06-01" who="jflanders.lfw">Swapped in improved slide for note and
        annotations, and added initial slide demonstrating the "more complex" markup idea.</change>
      <change when="2011-04-20" who="jflanders.lfw">Moved coverage of <gi>choice</gi>, <gi>add</gi>,
          <gi>del</gi>, other ms and transcription features, into basic_encoding.xml.</change>
      <change when="2010-12-06" who="jflanders.lfw">Updated to match revised content if
        necessary</change>
      <change when="2009-02-02" who="#JF">created file from editorial_markup and
        markup_challenges.</change>
    </revisionDesc>
  </teiHeader>
  <text>
    <presentation>
      <abstract>
        <p>This tutorial builds upon the basic encoding tutorial, which covers the most basic
          features of the TEI. This tutorial will cover how to demonstrate connections between
          various parts of the text through linking. This is particularly useful if your texts are
          heavily annotated (necessitating the use of notes). This tutorial also covers: Displaying
          page images (facsimiles) with your markup; linking between fragmented textual features
          (i.e. features where your markup and the textual divisions don’t line up perfectly); and
          encoding the appearance of the text (through marking changes in rendition and handwritten
          additions).</p>
      </abstract>
      <!--
   <section>
    <head>Linking to context …</head>
    <slide>
      <eg><![CDATA[<p>
  <persName ref="#charles_prat">Charles</persName> 
  felt his <term xml:lang="de" ref="#schadenfreude">schadenfreude</term> 
  intensify as the train approached
  <placeName ref="#puddlethwaite">Puddlethwaite</placeName>. 
  He closed <title ref="#moby_dick">Moby Dick</title> with a decisive
  snap that startled the sleeping passenger to his left. …
</p>]]></eg>
    </slide>
    <lectureNote>
      <p>We've already seen some examples of how we can contextualize the text …</p>
    </lectureNote>
   </section>
    
    <section>
      <head>… and the context</head>
      <slide>
        <eg><![CDATA[<div type="editorial">
  <listBibl>
    <bibl xml:id="moby_dick">
      <title level="m">Moby-Dick; or, The Whale</title>
      <author>
        <persName ref="#herman_melville">Melville, Herman</persName>
      </author>
      <pubPlace>New York</pubPlace>
      <publisher>Harper &amp; Brothers</publisher>
      <date>1851</date>
    </bibl>
  </listBibl>
  
  <list type="glossary">
    <item><gloss xml:id="schadenfreude">pleasure derived from 
      the misfortunes of others</gloss></item>
  </list>
  
  <listPlace>
    <place xml:id="puddlethwaite">
      <placeName>Puddlethwaite</placeName>
    </place>
    <place xml:id="greater_puddlethwaite">
      <placeName>Greater Puddlethwaite</placeName>
    </place>
  </listPlace>
  
  <listPerson>
    <person xml:id="charles_prat">
      <persName>
        <forename>Charles</forename>
        <surname>Prat</surname>
      </persName>
      <birth when="1865-04-01">
        <placeName ref="#greater_puddlethwaite">
          Greater Puddlethwaite, Berks
        </placeName>
      </birth>
      <death when="1916-09-15"/>
    </person>
    <person xml:id="herman_melville">
      <persName>
        <forename>Herman</forename>
        <surname>Melville</surname>
      </persName>
      <birth when="1819-08-01"/>
      <death when="1891-09-28"/>
    </person>
  </listPerson>
</div>]]></eg>
      </slide>
    </section>
    
    
    <section>
      <head>A fuller look at personography</head>
      <slide>
        <eg><![CDATA[<person xml:id="julia_flanders">
  <persName>Flanders, Julia Hammond</persName>
  <birth when="1965-02-21">
    <placeName ref="#l_new_york">New York</placeName>
  </birth>
  <death notBefore="2011"/>
  <affiliation from="2000">
    <orgName ref="#o_tei">Text Encoding Initiative Consortium</orgName>
  </affiliation>
  <education evidence="external"><name>Madison High School</name></education>
  <faith>undecided</faith>
  <langKnowledge>
    <langKnown tag="en">first language</langKnown>
    <langKnown tag="fr">reading, writing, speaking</langKnown>
    <langKnown tag="la">slight reading knowledge</langKnown>
    <langKnown tag="de">slight reading and speaking knowledge</langKnown>
    <langKnown tag="it">slight reading and speaking knowledge</langKnown>
    <langKnown tag="es">slight reading knowledge</langKnown>
  </langKnowledge>
  <nationality>US citizen</nationality>
  <socecStatus scheme="#wwp_ses" code="#r4"/>
  <occupation from="2000" evidence="external">
    Director, Women Writers Project
  </occupation>
  <residence from="1966" to="1983-09">
    <placeName ref="#l_jhf_madison">Parents' house in Madison, NJ</placeName>
  </residence>
  <residence from="1983-09" to="1987-06">
    <placeName ref="#l_massachusetts">Massachusetts</placeName>
  </residence>
  <residence from="1987-10" to="1989-06">
    <placeName ref="#l_cambridge_uk">Cambridge, UK</placeName>
  </residence>
  <residence from="1989-09-01" to="2001-10-31">
    <placeName ref="#l_providence">Providence, RI</placeName>
  </residence>
  <residence from="2001-11-01">
    <placeName ref="#l_smithfield">Smithfield, RI</placeName>
  </residence>
  <event when="2005-06-01" where="#l_providence">
    <p>Completed PhD</p>
  </event>
  <trait type="eye_color">
    <label>eye color</label>
    <desc>green</desc>
  </trait>
  <state type="marital_status">
    <label>marital status</label>
    <desc>partnered</desc>
  </state>
</person>]]> </eg>
      </slide>
    </section>

    <section>
      <head>Placeography</head>
      <slide>
        <eg><![CDATA[<listPlace>
  <place type="state" xml:id="l_rhode_island">
    <placeName>The State of Rhode Island and Providence Plantations</placeName>
    <country>United States of America</country>
    <region>New England</region>
  </place>
  <place type="settlement" xml:id="l_smithfield">
    <placeName>Smithfield</placeName>
    <region ref="#l_rhode_island"/>
    <location>
      <geo>41.915131 -71.671397</geo>
    </location>
  </place>
  <place xml:id="l_madison">
    <placeName>Madison</placeName>
    <placeName type="nickname">The Rose City</placeName>
    <population when="2000" atLeast="16530"/>
    <location>
      <geo>40.758611 -74.416111</geo>
    </location>
    <climate>
      <label>rainfall</label>
      <desc>moderate</desc>
    </climate>
    <climate>
      <label>temperature</label>
      <desc>temperate</desc>
    </climate>
  </place>
  <place xml:id="l_jhf_madison">
    <location>
      <address>
        <street>198 Central Avenue</street>
        <settlement>Madison</settlement>
        <region>New Jersey</region>
        <postCode>07940</postCode>
        <country>USA</country>
      </address>
    </location>
  </place>
</listPlace>]]></eg>
      </slide>
    </section>
    
   <section>
    <head>Textual splitting: parallelism at a more local level </head>
       <slide>
           <figure>
               <graphic url="../../../_utils/gfx/text_stream.png"/>
           </figure>
           <eg><![CDATA[<app>
   <rdg wit="#Q">sallied</rdg>
   <rdg wit="#F">solid</rdg>
</app>]]></eg>
           
       </slide>
       <lectureNote>
           <p>Parallelism also exists and may call for representation at a more local level: remember the <gi>choice</gi> element from yesterday</p>
           <p>In these cases it's more like a temporary forking or divergence in the text: a case of multiple possibilities</p>
           <p>These possibilities may arise from a number of different causes:
           <list>
               <item>From aspects of the text that we want to correct or regularize in some way</item>
               <item>From uncertainty about how the text should be read</item>
               <item>From disagreements between different versions of the text</item>
           </list>
           </p>
           <p>Our <quote>sallied/solid</quote> example is a case of textual disagreement; this line from Hamlet differs between the Folio and Quarto and we can represent that textual splitting, in this case, with the <gi>app</gi> element (critical apparatus) that groups together two or more different readings and indicates that they are alternatives</p>
       </lectureNote>
   </section> -->
      <section>
        <head>Basic encoding</head>
        <slide>
          <figure>
            <graphic height="400px" url="../../../_utils/gfx/basic_encoding.png"/>
          </figure>
        </slide>
        <lectureNote>
          <p>So far we have been looking mostly at two very basic functions that markup can perform: <list>
              <item>identifying the boundaries of textual features</item>
              <item>naming textual features</item>
            </list> These are both really important functions—fundamental to the ways markup can be
            useful to us. Knowing the boundaries of things, and distinguishing between them, are an
            essential foundation for everything else we do. </p>
          <p>We might think of this kind of markup as being almost like clothing: it closely follows
            the form of the feature it's surrounding, it draws our attention to it, it marks out its
            boundaries (not always in a "natural" way...). </p>
        </lectureNote>
        <tutorial>
          <p>So far we have been looking mostly at two very basic functions that markup can perform:
            identifying the boundaries of textual features and naming textual features.</p>
          <p>These are both really important functions—fundamental to the ways markup can be useful
            to us. Knowing the boundaries of things and distinguishing between them are essential to
            the foundation of text encoding.</p>
          <p>We might think of this kind of markup as being almost like clothing: it closely follows
            the form of the feature it's surrounding, it draws our attention to it, it marks out its
            boundaries (although, not always in a "natural" way).</p>
        </tutorial>
      </section>
      <section>
        <head>&#x201C;Advanced&#x201D; encoding</head>
        <slide>
          <figure>
            <graphic height="400px" url="../../../_utils/gfx/advanced_encoding.png"/>
          </figure>
        </slide>
        <lectureNote>
          <p>In this next session, we are going to move beyond this basic concept of markup to
            consider some more complex things that markup can help us do: <list>
              <item>create information-bearing links between things</item>
              <item>establish connections between parallel structures</item>
              <item>allow us to create information structures with the markup that don't necessarily
                follow the shape of the text, are not limited by its boundaries.</item>
            </list> The analogy here would not be clothing but maybe architecture. </p>
        </lectureNote>
        <tutorial>
          <p>In this tutorial, we are going to move beyond this basic concept of markup to consider
            some more complex things that markup can help us do. This includes creating
            information-bearing links between things and establishing connections between parallel
            structures. These mechanisms allow us to create information structures with the markup
            that don't necessarily follow the shape of the text, are not limited by its
            boundaries.</p>
        </tutorial>
      </section>

      <section>
        <head>Notes and annotations</head>
        <slide>
          <egMarkup scheme="TEI">
            <body>
              <!-- ... -->
              <p xml:id="p01"><persName xml:id="pn01">Mr. Lintott</persName>, ſome time ſince, 
                intending to Reprint my Poems, deſir’d me to permit him to add to 
                ’em a Dialogue I had in the Year 1700, written on a Sermon preach’d by 
                <persName xml:id="pn02">Mr. Sprint</persName>, a Non-Conformist, at 
                <placeName xml:id="pl01">Sherbourn</placeName> in Dorſetſhire: I refuſing, 
                for ſeveral Reaſons, to grant his Request, he, without my Knowledge, bought 
                the Copy <seg xml:id="sg01">of</seg> the Bookſeller who formerly Printed it,
                and, without my Conſent, or once acquainting me with his Reſolution, added
                it to the Second Edition of my Poems: and that which makes the Injury the
                greater, is, his having omitted both the Epiſtle Dedicatory and the
                Preface<anchor xml:id="a01"/>; by which means, he has left the Reader wholly in
                the Dark, and expos’d me to Cenſure.
              </p>
            </body>
            <back>
              <div type="notes">
                <note target="#p01">This paragraph expresses Chudleigh's genuine alarm at 
                  the piracy of her work, but it is also somewhat formulaic; the chain of 
                  events she rehearses is a variant on a stock narrative often offered by 
                  female authors as an excuse for the appearance of their work in public.</note>
                <note target="#pn01">Bernard Lintott (December 1, 1675 – February 9, 1736), 
                  English publisher.</note>
                <note target="#pn02">Not identified.</note>
                <note target="#sg01">It is not clear whether Chudleigh used the word
                  <mentioned>of</mentioned> or <mentioned>from</mentioned> in the
                  original manuscript.</note>
                <note target="#a01">In a letter to her sister in which she quoted this 
                  passage, Chudleigh mentioned an omitted Appendix as well; however, 
                  this has never been found.</note>
                <note target="#pl01">Sherbourne, a market town in northwest Dorset, England</note>
              </div>
            </back>
          </egMarkup>
        </slide>
        <lectureNote>
          <p>One very important form of structural complexity: a hypertextual sprout or fork or jump
            in the textual stream <list>
              <item>For example, a footnote: which sprouts off from the text at a certain
                point</item>
              <item>Or an endnote, where there's in effect a cross-reference from a place in the
                text to a subsequent explanation</item>
            </list>
          </p>
          <p>In TEI, all types of annotations are encoded using the <gi>note</gi> element (except
            in certain special cases for which <gi>annotation</gi> or <gi>annotationBlock</gi> may
            be used). These can be classified to indicate responsibility or to indicate the kind
            of note (using any classification system that seems useful, e.g. annotation, correction,
            hypothesis, context, gloss, etc.)</p>
          <p>We're illustrating here several different levels of annotation: <list>
              <item>at a specific point (but note that in this case we don't know anything very
                specific about what the annotation is really annotating)</item>
              <item>a specific name</item>
              <item>a specific quotation</item>
              <item>an arbitrary word not already marked up</item>
              <item>a location in the text</item>
            </list> The notes themselves can go anywhere; what we are illustrating here has you
            putting the notes into a special division in the back matter. </p>
          <p>In addition, there may be some kinds of annotation that can be handled other ways, not
            with <gi>note</gi> but with something more flexible; in this example we show place names
            being linked to a gazetteer or <soCalled>placeography</soCalled>, which records
            additional information about the place (a regularized version of the name, a brief note
            about it, a location with lat-long). This same approach could be used for the names of
            people as well. We will talk more about these later in the workshop</p>
        </lectureNote>
        <tutorial>
          <p>Notes and annotations are one very important form of structural complexity. They serve
            as a hypertextual fork in the textual stream. For example, a footnote sprouts off from
            the text at a certain point. It is not technically meant to be read where it occurs on
            the page, and in many ways sits apart from the rest of the text. Endnotes follow a
            similar principle, in that they're not meant to be read as a whole all at once. There's
            instead a cross-reference from a place in the text to a subsequent explanation.</p>
          <p>In TEI, all types of annotations are encoded using the <gi>note</gi> element (except
            in certain special cases for which <gi>annotation</gi> or <gi>annotationBlock</gi> may
            be used). These can be classified to indicate responsibility, or to indicate what kind
            of note (using any classification system that seems useful, e.g. annotation, correction,
            hypothesis, context, gloss, etc.)</p>
          <p>You can see from the <att>target</att> attribute on <gi>note</gi> where the notes are
            anchored in the text. In this example, we're illustrating several different levels of
            annotation. The notes that use <gi>anchor</gi> are placed at a specific point, such as
            where the asterisk or superscripted number appears on the page (but note that in this
            case we don't know anything very specific about what the annotation is really
            annotating).</p>
          <p>We can also anchor our notes to other bits of markup—the things that are being
            annotated. So for example, we can annotate a specific name, a specific quotation, an
            arbitrary word not already marked up, and a location in the text (all examples in the
            example).</p>
          <p>The notes themselves can go anywhere; the example here has the notes into a special
            division in the back matter.</p>
          <p>In addition, there may be some kinds of annotation that can be handled other ways, not
            with <gi>note</gi> but with something more flexible; in future slides we will discuss
            contextual encoding, which records additional information about entities referenced in
            the text (for example, regularized versions of names, brief notes, standardized data).
            If you are interested in a more detailed look at this topic, see our <ref
              target="../../../../resources/context.html">Contextual Encoding Primer</ref>.</p>
        </tutorial>
      </section>

      <section>
        <head>Figures and Images</head>
        <slide>
          <egMarkup scheme="TEI">
            <figure>
              <head>Liza Kalvelage</head>
              <graphic url="LKdrawing.jpg"/>
              <figDesc>A cartoonish drawing of Liza Kalvelage leading a peace rally.</figDesc>
              <ab type="caption">Liza Kalvelage at a rally, possibly by Alice Brock.</ab>
              <floatingText>
                <body>
                  <p>War is not healthy for children and other living things</p>
                </body>
              </floatingText>
              <note type="editorial">
                In the drawing Kalvelage is portrayed as leading a rally or parade.
                She is carrying a sign that is clearly intended to evoke the
                <ref target="http://www.artlex.com/ArtLex/p/images/poster_schneider_war_lg.jpg">logo</ref>
                of
                <ref target="http://www.anothermother.org/">Another Mother for Peace</ref>.
              </note>
            </figure>
          </egMarkup>
        </slide>
        <lectureNote>
          <p>Figures: <list>
              <item>Heading (transcribed from the source): <gi>head</gi></item>
              <item>A link to the image file: <gi>graphic</gi> with <att>url</att></item>
              <item>A description of the image, for accessibility: <gi>figDesc</gi></item>
              <item>A caption (transcribed from the source): <gi>ab</gi></item>
              <item>A transcription of the writing that is found within the graphic:
                  <gi>floatingText</gi></item>
            </list></p>
        </lectureNote>
        <tutorial>
          <p>This example shows how to markup and describe figures or images. This particular image
            contains a heading (transcribed from the source): the <gi>head</gi> element; the
              <gi>graphic</gi> with <att>url</att> contains a link to the source of the image. The
              <gi>figDesc</gi> element allows us to provide a description of the image, for the sake
            of accessibility. This element is especially useful if you want to encode a text when
            you don't have the rights to the page images. A caption (transcribed from the source) is
            also included, encoded using the <gi>ab</gi> element. We use the <gi>ab</gi> (or
              <q>anonymous block</q>) element when we encounter textual chunks that aren't exactly
            paragraphs, but still need to be marked with some type of chunk-like element. A
            transcription of the writing that is found within the graphic is recorded using the
              <gi>floatingText</gi> element.</p>
        </tutorial>
      </section>
      <section>
        <head>Facsimiles and Page Images</head>
        <slide>
          <egMarkup scheme="TEI">
            <body>
              <pb facs="page01.tif"/>
              <p>
                <seg type="decorated_capital" facs="page01_detail.tif">H</seg>ere 
                beginneth the firste booke ...
              </p>
            </body>
          </egMarkup>
        </slide>
        <lectureNote>
          <p>Facsimiles of pages and parts of pages: <list>
              <item>The <att>facs</att> attribute is available on any element; use as
                appropriate</item>
              <item>It points to an image file (could be a whole page, or just a detail)</item>
            </list>
          </p>
        </lectureNote>
        <tutorial>
          <p>If you do have access and rights to page images, it is sometimes useful to associate
            facsimiles of pages and parts of pages with your transcribed and encoded document: The
              <att>facs</att> attribute is available on any element; it points to an image file,
            either whole page or just a detail. You can use it to associate parts of your encoded
            document with a facsimile.</p>
        </tutorial>
      </section>

      <section>
        <head>Representing Rendition</head>
        <slide>
          <p>Simple: one fact at a time:</p>
          <list rend="unordered">
            <item>
              <tag>name rend="italic"</tag>
            </item>
            <item>
              <tag>p rend="indent"</tag>
            </item>
            <item>
              <tag>text rend="blackletter"</tag>
            </item>
          </list>

          <p>As a complex solution when you need to say more, let <att>rend</att> or
            <att>style</att> contain structured information:
            <egMarkup scheme="TEI">
              <head rend="case(upper)slant(italic)align(center)"> ... </head>
            </egMarkup>
            <egMarkup scheme="TEI">
              <head style="font-style:italic; text-align:center;"> ... </head>
            </egMarkup>
          </p>
        </slide>
        <lectureNote>
          <p>We've been talking about showing page images and facsimiles, which is a great way to
            give a very accurate representation of the source, but doesn't give us access to
              <emph>data</emph> about how the source document looked. When we want to include that
            data in our transcription, we can do so using the <att>rend</att> attribute, which is
            available on all TEI elements.</p>
          <p>If you just want to say one simple thing about the appearance of an element (eg.
            italics, centered, bold, whatever) you can use the simple keyword approach at the top
            here.</p>
          <p>If you need to say more than one thing about the rendition of a given element, then you
            need to provide some internal structure inside the <att>rend</att> attribute. One way to
            do this is with something known as <term>rendition ladders</term> (which are not in wide
            use, but are fairly elegant). Another approach would be to use CSS style descriptors. </p>
          <p>If you're not using the CSS method, you make up the values yourself: the TEI does not
            provide any suggested values.</p>
        </lectureNote>
        <tutorial>
          <p>We've been talking about showing page images and facsimiles, which is a great way to
            give a very accurate representation of the source, but doesn't give us access to data
            about how the source document looked. When we want to include that data in our
            transcription, we can do so using the <att>rend</att> attribute, which is available on
            all TEI elements.</p>
          <p>If you just want to say one simple thing about the appearance of an element (eg.
            italics, centered, bold, and so on) you can use the simple keyword approach at the top
            of this slide.</p>
          <p>If you need to say more than one thing about the rendition of a given element, then you
            need to provide some internal structure inside the <att>rend</att> attribute. One way to
            do this is with something known as rendition ladders (which are not in wide use, but are
            fairly elegant). Another approach would be to use CSS style descriptors on the
              <att>style</att> attribute.</p>
          <p>If you're not using the CSS method (i.e. you want to use the <att>rend</att>
            attribute), you make up the values yourself. The TEI does not provide any suggested
            values, so you can make up the attribute values according to what your project needs.
          </p>
        </tutorial>
      </section>

      <section>
        <head>Handwriting</head>
        <slide>
          <egMarkup scheme="TEI">
            <!-- In the header -->
            <profileDesc>
              <handNotes>
                <handNote xml:id="scribeA" scribeRef="#asrednalf">Irregular scrawl, possibly left-handed</handNote>
                <handNote xml:id="scribeB" scribeRef="#jflanders">Flowing calligraphic script</handNote>
                <handNote xml:id="scribeC" scribeRef="#jflanders">Compulsive block capitals</handNote>
              </handNotes>
            </profileDesc>
            <!-- ... -->
            <!-- In the text -->
            <p hand="#scribeA">As I write this, I realize that 
              everything <subst hand="#scribeB"><del>is completely ridiculous</del>
              <add>makes perfect sense</add></subst>. <add hand="#scribeC">Or not!</add></p>
          </egMarkup>
        </slide>
        <tutorial>
          <p>The TEI also provides a method for you to define different hands that appear in your
            text. The <gi>handNotes</gi> element allows you to describe the appearance of different
            handwritings, as well as defining whose hand is being described.</p>
            <p>The <att>hand</att> attribute indicates which hand you
            are asserting wrote a given passage. For elements that do
            not have a <att>hand</att> attribute (e.g., <gi>item</gi>)
            or when handwriting changes in the middle of a passage,
            the <gi>handShift</gi> element is used, and the
            <att>new</att> attribute allows you to point to a specific
            hand in the <gi>handNotes</gi>, which essentially says
            <q>this new hand starts here.</q></p>
        </tutorial>
      </section>
      <section>
        <head>Critical apparatus</head>
        <slide>
          <egMarkup scheme="TEI">
            <p>They created a 
            <app>
              <lem wit="#MS_A #MS_C">horrible</lem>
              <rdg wit="#MS_B" type="substantive">horrific</rdg>
              <rdg wit="#MS_D" type="orthographic">horible</rdg>
            </app>
            muddle with their meddling.</p> 
            <!-- ... -->
            <!-- somewhere else in the document: -->
            <!-- ... -->
            <listWit>
              <witness xml:id="MS_A">Original notebook, 1988</witness>
              <witness xml:id="MS_B">Fair copy, 1989</witness>
              <witness xml:id="MS_C">Transcription sent to publisher, 1990</witness>
              <witness xml:id="MS_D">Rough transcription</witness>        
            </listWit>
          </egMarkup>
        </slide>
        <lectureNote>
          <p>We can also represent a plurality of editorial opinions or textual witnesses as a piece
            of critical apparatus, using the <gi>app</gi> element. The optional <gi>lem</gi> gives
            the reading of the "base text", and the two <gi>rdg</gi> elements each represent a
            different editorial view of what the text really means.</p>
          <p>What if we have a plurality of readings because we have multiple witnesses? Here's an
            example of a hypothetical text that is a critical amalgam of two separate witnesses with
            slight local differences. The witnesses themselves are documented in a <gi>listWit</gi>
            element, and the individual readings are associated with the appropriate witness using
            the <att>wit</att> attribute. Note that you can associate a given reading with more than
            one witness if that's more economical.</p>
        </lectureNote>
        <tutorial>
          <p>We can also represent a plurality of editorial opinions or textual witnesses as a piece
            of critical apparatus, using the <gi>app</gi> element. The optional <gi>lem</gi> gives
            the reading of the "base text", and the two <gi>rdg</gi> elements each represent a
            different editorial view of what the text really means (i.e a "reading"), each
            associated with a particular witness, represented by the <att>wit</att> attribute.</p>
          <p>What if we have a plurality of readings because we have multiple witnesses? Here's an
            example of a hypothetical text that is a critical amalgam of two separate witnesses with
            slight local differences. The witnesses themselves are documented in a <gi>listWit</gi>
            element, and the individual readings are associated with the appropriate witness using
            the <att>wit</att> attribute. Note that you can associate a given reading with more than
            one witness if that's more economical.</p>
        </tutorial>
      </section>

      <section>
        <head>Generic markup structures</head>
        <slide>
          <table>
            <row role="label">
              <cell/>
              <cell>Predefined semantics</cell>
              <cell>User-defined semantics</cell>
            </row>
            <row>
              <cell role="label">Division-level</cell>
              <cell><gi>titlePage</gi>, <gi>argument</gi>, <gi>postscript</gi> </cell>
              <cell><tag>div type="recipe"</tag></cell>
            </row>
            <row>
              <cell role="label">Chunk-level</cell>
              <cell><gi>list</gi>, <gi>p</gi>, <gi>quote</gi></cell>
              <cell><tag>ab type="ingredient"</tag></cell>
            </row>
            <row>
              <cell role="label">Phrase-level</cell>
              <cell><gi>name</gi>, <gi>emph</gi></cell>
              <cell><tag>seg type="note_anchor"</tag></cell>
            </row>
            <row>
              <cell role="label">Milestones</cell>
              <cell><tag type="empty">pb</tag>, <tag type="empty">lb</tag></cell>
              <cell><tag type="empty">milestone type="filmReelBreak"</tag></cell>
            </row>
            <row>
              <cell role="label">Spots</cell>
              <cell><tag type="empty">handShift</tag></cell>
              <cell><tag type="empty">anchor type="endQuoteSpan"</tag></cell>
            </row>
          </table>
        </slide>
        <lectureNote>
          <p>We've gone over a fair number of TEI elements with quite specific purposes so far, and
            there are hundreds more out there--the TEI has anticipated a large number of textual
            features that we're going to want to encode, and created elements for them. However, the
            universe of texts is much larger than the universe of the TEI, and the TEI knows this: <list>
              <item>it can't possibly anticipate all the things people are going to want to
                encode</item>
              <item>even if it could, that's not a good way to design an encoding system</item>
            </list>
          </p>
          <p>Instead, the TEI provides a fall-back mechanism, a set of generic elements that
            encoders can use to encode the unforeseen. In these generic elements, instead of giving
            the element itself a very specific meaning (for instance, personal name, stage
            direction), the element itself carries almost no meaning at all: it just says "thing!"
            The semantics, the meaning of the element, is carried in an attribute value, which can
            be made up by the encoder. </p>
          <p>As we show here, there are three main generic elements in TEI, one for each structural
            level: <list>
              <item>At the division level, we've already encountered the <gi>div</gi> element, from
                which we can fabricate chapters and sections and things of that scale</item>
              <item>At the chunk level (things like paragraphs and lists), we have the <gi>ab</gi>
                element (stands for "anonymous block")</item>
              <item>At the word or phrase level, we have the <gi>seg</gi> element (short for
                "segment"). </item>
            </list>
          </p>
        </lectureNote>
        <tutorial>
          <p>We've gone over a fair number of TEI elements with quite specific purposes so far, and
            there are hundreds more out there—the TEI has anticipated a large number of textual
            features that we're going to want to encode, and created elements for them. However, the
            universe of texts is much larger than the universe of the TEI, and the TEI knows this.
            It can't possibly anticipate all the things people are going to want to encode, and even
            if it could, that's not a good way to design an encoding system.</p>
          <p>Instead, the TEI provides a set of generic elements that encoders can use to encode the
            unforeseen. In these generic elements, instead of giving the element itself a very
            specific meaning (for instance, personal name, stage direction), the element itself
            carries almost no meaning at all: it just says "thing!". The semantics, the meaning of
            the element, is carried in an attribute value, which can be made up by the encoder.</p>
          <p>As we show here, there are three main generic elements in TEI, one for each structural
            level: At the division level, we've already encountered the <gi>div</gi> element, from
            which we can fabricate chapters and sections and things of that scale. At the chunk
            level (things like paragraphs and lists), we have the <gi>ab</gi> element (stands for
            "anonymous block"). At the word or phrase level, we have the <gi>seg</gi> element (short
            for "segment"). There are also two generic empty elements that can replace more specific
            empty elements, like <gi>pb</gi> or <gi>handShift</gi>: <gi>milestone</gi> and
              <gi>anchor</gi>. Milestone is generally used for regularly repeating structures, like
            pages and signatures. Anchors, as we saw earlier, are often used for things like
            footnotes and endnotes.</p>
        </tutorial>
      </section>

      <section>
        <head>Empty elements used as milestones</head>
        <slide>
          <!--      <figure>
            <figDesc>[Need a graphic here illustrating what milestones do]</figDesc>
            </figure>  -->
          <egMarkup scheme="TEI">
            <p>An elevator is as ugly a monster as has been yet
            ...
            within its reach has all been swallowed, masticated, and
            <pb n="249"/>
            <milestone unit="sig" n="R5r"/>
            <lb/>digested. Its long trunk, as seen slanting down from
            <lb/>out of the building across the wharf and into the ship,
            <lb/>is a mere wooden pipe; but this pipe is divided within.
            <lb/>It has two departments; and as the grain-bearing 
            <lb/>troughs pass up the one on a pliable band, they pass
            <lb/>empty down the other. The system therefore is that
            <lb/>of an ordinary dredging machine; only that corn, and
            <lb/>not mud is taken away, and that the buckets or 
            <lb/>troughs are hidden from sight. Below, within the
            <lb/>stomach of the poor bark, three or four labourers are
            <lb/>at work, helping to feed the elevator. They shovel
            <lb/>the corn up towards its maw, so that at every swallow
            <lb/>he should take in all that he can hold ...
            <lb/>... The transit of the bushels 
            <lb/>of corn from the larger vessel to the smaller will have
            <lb/>taken less than a minute, and the cost of that transit
            <lb/>will have been—a farthing.</p>
            <pb n="250"/>
            <milestone unit="sig" n="R5v"/>
          </egMarkup>
        </slide>
        <lectureNote>
          <p>Simplest option: instead of encoding the feature by enclosing it in an element, instead
            just mark its boundaries with empty elements</p>
          <p>The most common case of this is with milestone elements: <list>
              <item>Elements that divide the text into segments according to some system: pages,
                columns, lines</item>
              <item>works perfectly for an information structure which is completely flat and
                divides up the whole text into parts: page breaks, signatures, reels of a
                movie</item>
              <item>i.e. there's nothing in the text that isn't on some page; there's nothing in a
                paragraph that's not on some line</item>
              <item>in these cases, you mark the boundaries between segments, so each boundary
                element marks the end of one segment and the start of the next.</item>
            </list>
          </p>
        </lectureNote>
        <tutorial>
          <p>As a thought experiment, let's think about XML overlap. If you think back to the first
            tutorial in this primer, when we discussed <ref
              target="../../xml_intro/xml_newIntro_tutorial_13.xhtml">XML overlap</ref>, you may
            remember that we discussed that you can't have elements that aren't perfectly nested. In
            some cases, the simplest option may be to mark the beginning and end point of a given
            textual feature with empty elements. (As a reminder, empty elements are recorded like
            start tags, but with a forward slash after the element name and before the final angle
            bracket, like so: &lt;emptyElement /&gt;). Milestone elements are the generic empty
            elements that allow us to mark where textual features begin and/or end.</p>
          <p>Milestone elements are the most common empty elements you will encounter in a TEI
            document. We talked about this just a moment ago, but milestone elements divide the text
            into segments according to some system: pages, columns, lines. It works perfectly for an
            information structure which is completely flat and divides up the whole text into parts:
            page breaks, signatures, reels of a movie (i.e. there's nothing in the text that isn't
            on some page; there's nothing in a paragraph that's not on some line). The particular
            example on this page is dividing the page up into signatures.</p>
          <p>In these cases, you mark the boundaries between segments, so each boundary element
            marks the end of one segment and the start of the next.</p>
        </tutorial>
      </section>

      <section>
        <head>Empty elements used as endpoints</head>
        <slide>
          <!--     <figure>
            <figDesc>[Need a graphic here illustrating what endpoints do; maybe a
            separate slide with image plus encoding showing long deletion or
            addition]</figDesc>
            </figure>
              -->
          <egMarkup scheme="TEI">
            <p>... for the elevator is an amphibious insti-
            <lb break="no"/>tution, and flourishes only on the banks of navigable
            <lb/>waters. When its head is ensconced within its box,
            <lb/>and the beast of prey is thus nearly hidden within
            <lb/>the building, the unsuspicious vessel is brought up
            <lb/>within reach of the creature's trunk, and down it
            <lb/>comes, like a mosquito's proboscis, right through the
            <lb/>deck, in at the open aperture of the hold, and so into
            <lb/>the very vitals and bowels of the ship. <delSpan spanTo="#spanEnd01"/>When there,
            <lb/>it goes to work upon its food with a greed and
            <lb/>avidity that is disgusting to a beholder of any taste
            <lb/>or imagination.</p>
            <p>And now I must explain the anatomical
            <lb/>arrangement by which the elevator still
            <lb/>devours and continues to devour, till the corn within
            <lb/>its reach has all been swallowed, masticated, 
            and digested.<anchor xml:id="spanEnd01"/></p>
          </egMarkup>
          <egMarkup scheme="TEI">
            <addSpan spanTo="#addEnd01"/>
            <p>An elevator is as ugly a monster as has been yet
            <lb/>produced. In uncouthness of form it outdoes those
            <lb/>obsolete old brutes who used to roam about the semi-
            <lb break="no"/>acqueous world, and live a most uncomfortable life
            <lb/>with their great hungering stomachs and huge un-
            <lb break="no"/>satisfied maws. The elevator itself consists of a big
            <lb/>moveable trunk,—moveable as is that of an elephant,
            <lb/>but not pliable, and less graceful even than an ele-
            <lb break="no"/>phant's. This is attached to a huge granary or barn ...</p>
            <anchor xml:id="addEnd01"/>
          </egMarkup>
        </slide>
        <lectureNote>
          <p>But in addition there are other cases where it's handy to be able to mark the ends of
            an element at arbitrary places, rather than having to fit the element neatly into the
            document hierarchy <list>
              <item>classic example is additions and deletions: authors often add large chunks of
                stuff, or delete parts of things that don't match the textual structure</item>
            </list>
          </p>
          <p>For these, as we saw briefly yesterday, we can mark them much more effectively by
            putting an empty element at each end, sort of like marking the boundaries of an
            impromptu soccer field by putting your shoes at each end</p>
          <p>Then create a link between the two, using the pointing system we talked about
            yesterday...</p>
        </lectureNote>
        <tutorial>
          <p>In addition there are other cases where it's handy to be able to mark the ends of an
            element at arbitrary places, rather than having to fit the element neatly into the
            document hierarchy. A classic example of this we find in additions and deletions;
            authors often add large chunks of stuff, or delete parts of things that don't match the
            textual structure.</p>
          <p>We can mark these types of textual features much more effectively by putting an empty
            element at each end, sort of like marking the boundaries of an impromptu soccer field by
            putting your shoes at each end. We then create a link between the two so that we can be
            clear about where the thing we're marking up begins and ends.</p>
          <p>In this example, we see a large chunk of deleted text and a large chunk of added. In
            the first example, we cannot simply place the start- and end-tags for a <gi>del</gi>
            element where the <gi>delSpan</gi> and <gi>anchor</gi> elements are because that would
            create XML overlap (bad!). The second example wouldn't work with <gi>add</gi> because
            that's a phrase-level element (and therefore must go inside <gi>p</gi>, rather than
            outside. In both of these cases empty elements provide us with a solution.</p>
        </tutorial>
      </section>

      <section>
        <head>Fragmentation</head>
        <slide>
          <!-- 
            <figure>
            <figDesc>[Need graphic here showing source text; also need graphic showing
            how fragmentation works]</figDesc>
                  </figure>  -->
          <egMarkup scheme="TEI" type="valid">
            <sp>
              <speaker>Leo.</speaker>
              <l part="F">Go on, go on:</l>
              <l>Thou canst not speake too much, I have deserv'd</l>
              <l part="I" y:interest="content"><y:hi style="color: #8E6C16;">All tongues to talk their bittrest.</y:hi></l>
            </sp>
            <sp>
              <speaker>Lord.</speaker>
              <l part="F" y:interest="content"><y:hi style="color: #8E6C16;">Say no more;</y:hi></l>
              <l>How ere the business goes, you have made fault</l>
              <l part="I"><y:hi style="color: fuchsia;">I'th boldnesse of your speech.</y:hi></l>
            </sp>
            <sp>
              <speaker>Pauline.</speaker>
              <l part="F"><y:hi style="color: fuchsia;">I am sorry for't;</y:hi></l>
              <l>All faults I make, when I shall come to know them</l>
              <!-- ... -->
            </sp>
          </egMarkup>
        </slide>
        <lectureNote>
          <p>Take what is logically a single content object <list>
              <item>encode it as multiple separate XML elements</item>
              <item>indicate that each XML element is only a <soCalled>partial</soCalled>
                element</item>
              <item>optionally have each partial element indicate which is the next piece of the
                whole content object</item>
            </list>
          </p>
          <p>TEI provides 2 methods for doing this; the first is the <att>part</att> attribute... </p>
          <p>The <att>part</att> attribute can be used for <soCalled>serial</soCalled> cases: <list>
              <item>all fragments are in sequential order</item>
              <item>no intervening occurrence of same element type that is <emph>not</emph> part of
                the aggregate element</item>
              <item>e.g., good for <gi>l</gi> but sometimes not <gi>q</gi></item>
              <item>available on <gi>l</gi>, <gi>lg</gi>, <gi>div</gi>, <gi>seg</gi>, <gi>ab</gi>,
                  <gi>s</gi>, <gi>cl</gi>, <gi>phr</gi>, <gi>w</gi>, <gi>m</gi>, <gi>c</gi></item>
            </list>
          </p>
        </lectureNote>
        <tutorial>
          <p>Sometimes XML structures don't perfectly represent the way that we think about texts.
            For example, in dramatic poetry, sometimes <gi>l</gi> (individual lines) are separated
            across <gi>sp</gi> elements. In the examples, we see some blank verse, with iambic
            pentameter lines divided between two characters. In this case, the TEI allows us to use
            fragmentation to show that these are a part of a single content object.</p>
          <p>In these cases, we encode the content object (in this case the metrical line) as
            multiple separate XML elements. We then indicate that each XML element is only a partial
            element. Optionally, we can have each partial element indicate which is the next piece
            of the whole content object.</p>
          <p>TEI provides two methods for doing this (the second is on the following slide). The one
            in the example uses the <att>part</att> attribute to indicate that the lines are
            divided. The <att>part</att> attribute can be used for serial cases (when all fragments
            are in sequential order).</p>
          <p>This attribute is available on the <gi>l</gi>, <gi>lg</gi>, <gi>div</gi>, <gi>seg</gi>,
              <gi>ab</gi>, <gi>s</gi>, <gi>cl</gi>, <gi>phr</gi>, <gi>w</gi>, <gi>m</gi>, and
            <gi>c</gi> elements.</p>
        </tutorial>
      </section>

      <section>
        <head>Another approach to fragmentation</head>
        <slide>
          <!-- From https://www.google.com/books/edition/Poems/nchYAAAAcAAJ?hl=en&gbpv=1&dq=%22mortal+she+said+i%27m+sent+to+you%22&pg=PA28&printsec=frontcover -->
          <eg> Mortal, she said, “I’m sent to you,
 Then hold my precepts fast;
 Remember earth’s best joys are few,
 And can’t for ever last.” </eg>
          <egMarkup scheme="TEI">
            <lg type="stanza">
              <l>Mortal, she said, <said xml:id="s01" next="#s02">I'm sent to you,</said></l>
              <l><said xml:id="s02" next="#s03" prev="#s01">Then hold my precepts fast;</said></l>
              <l><said xml:id="s03" prev="#s02" next="#s04">Remember earth's best joys are few,</said></l>
              <l><said xml:id="s04" prev="#s03">And can't for ever last.</said></l>
            </lg>
          </egMarkup>
        </slide>
        <lectureNote>
          <p>The <att>next</att> and <att>prev</att> attributes can be used for any cases: <list>
              <item>available on <emph>every</emph> element when additional tagset for segmentation
                &amp; alignment is used</item>
              <item>each fragment must bear either <att>next</att> or <att>prev</att></item>
              <item>probably better if each fragment bears both</item>
            </list>
          </p>
        </lectureNote>
        <tutorial>
          <p>Another method for addressing fragmentation comes from the <att>next</att> and
              <att>prev</att> attributes. These attributes are available on every element. This method is commonly used on
            elements like <gi>said</gi> or <gi>quote</gi> that begin in the middle of one paragraph
            or line, and end in the next. In order to indicate fragmentation this way, you should
            put an xml:id on each line. You then use the <att>next</att> and <att>prev</att>
            attributes to indicate which element comes before or after the element listed.</p>
          <p>For example: <![CDATA[
<p>A person using the TEI encountered a very long bit of text. He cried, <said xml:id="s001" next="s002">How can I ever encode this <said> element if it crosses a paragraph?</said></p>
<p><said xml:id="s002" prev="s001">I want to indicate that there is only one utterance, but the paragraph interrupts it! And I can't start the element in the middle of a paragraph, because that would cause xml:overlap!</said></p>]]>
          </p>
        </tutorial>
      </section>

      <section>
        <head>And then:</head>
        <slide>
          <p>Other advanced features we should show you...?</p>
        </slide>
        <tutorial>
          <p>Please skip this slide, it is specific to our workshops.</p>
          <list>
            <head>This tutorial is complete, please see links below to continue:</head>
            <item><ref target="../metadata/metadata_tutorial_00.xhtml">Proceed to next tutorial in
                TEI Primer</ref></item>
            <item><ref target="../../../../resources/tei_prim.html">Return to TEI
              Primer</ref></item>
            <item><ref target="../../../../resources/tutorial_main.html">Return to main tutorial
                page</ref></item>
          </list>
        </tutorial>
      </section>

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