<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="../stylesheets/yaps-tei.css"?>
<?oxygen RNGSchema="../schema/yaps.rnc" type="compact"?>
<?oxygen SCHSchema="../schema/yaps.sch"?>
<TEI xmlns="http://www.wwp.brown.edu/ns/yaps/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.0">
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>Pointing</title>
        <author>Syd Bauman</author>
      </titleStmt>
      <xi:include href="./boilerplate_publicationStmt.xml">
        <xi:fallback>
          <publicationStmt status="restricted">
            <note type="auto">WARNING: XInclude processing failed &#x2014; this file should not be copied or
            used (and is invalid) as a result.</note>
          </publicationStmt>
        </xi:fallback>
      </xi:include>
      <sourceDesc>
        <p>Based on the Stanford version, but trimmed down a
        lot</p>
      </sourceDesc>
    </fileDesc>
    <revisionDesc>
      <change>Put XInclude back in (taking
      it from uvic2006, I think)</change>
      <change>Trim down by removing
        inclusions and the details that really are about
        auto-generating text</change>
      <change when="2006-03-13" who="#SB">automatically converted from
        presentation.odd conforming to yaps.odd conforming using p2y.xslt and
        p2y.perl</change>
      <change when="2006-02-15" who="#JHF">Added clarifying words</change>
      <change when="2006-02-17" who="#sdb">Updated from xref only to pointing
        and XPointer</change>
    </revisionDesc>
  </teiHeader>
  <text>
    <presentation>
      <section>
        <head>Pointing</head>
        <slide>
          <eg>&lt;castList&gt;
  &lt;castItem type="role"&gt;
    &lt;role <hi>xml:id="CK"</hi>&gt;Clark Kent&lt;/role&gt;
    &lt;roleDesc&gt;Mild-mannered reporter for a great
      metropolitan newspaper&lt;/roleDesc&gt;
  &lt;/castItem&gt;
&lt;/castList&gt;
&lt;!-- ... --&gt;
&lt;sp <hi>who="#CK"</hi>&gt;
  &lt;speaker&gt;Clrk.&lt;/speaker&gt;
  &lt;p&gt;I don't know Lois, I must have fainted.&lt;/p&gt;
&lt;/sp&gt;</eg>
          <p>When one XML element formally refers to another XML
            element, we say the one element <term>points</term>
            to the other</p>
          <p>This is done through an attribute: the value of a
              <soCalled>pointer</soCalled> attribute is a URI
            that resolves to an XML element or other
          resource.</p>
        </slide>
      </section>
      <section>
        <head>In XHTML</head>
        <slide>
          <list>
            <item>The <gi>a</gi> element's <att>href</att>
              attribute points to another <gi>a</gi> element via
              its <att>name</att> attribute.</item>
            <item>The <gi>img</gi> element's <att>src</att>
              attribute points to a graphics file, e.g. a JPEG
              or PNG.</item>
          </list>
          <eg>&lt;a href="#duck"&gt;</eg>
          <eg>&lt;a href="http://www.quack.com/fowl.html#duck"&gt;</eg>
<!-- http://bauman.zapto.org/gallery/academiaSinicaTEI2006/2006_03_04T04_51_21 -->
<!-- http://bauman.zapto.org/gallery/TEI_Council_Paris_2005/04_29T18_57_27" -->
          <eg>&lt;img src="http://bauman.zapto.org/gallery/commencement2005/2005_05_29t133624"
     alt="Julia gets her PhD"&gt;</eg>
        </slide>
        <handoutNote>
          <p>Note that the <gi>img</gi> tag is a start-tag, not
            an emtpy-element-tag. That is on purpose. In a slide
            like this I am only showing the start-tag, because
            the point of discussion in the attributes. I didn't
            show the content or end-tag of the <gi>a</gi>
            elements either.</p>
        </handoutNote>
      </section>
      <section>
        <head>In TEI</head>
        <slide>
          <list>
            <item>Any element may be identified by its
                <att>xml:id</att> attribute.</item>
            <item>Many elements have a variety of attributes
              that point for a variety of reasons. E.g.:<list><item><att>who</att> of <gi>sp</gi> indicates
                  which character is speaking</item><item><att>sameAs</att> of any element indicates it
                  is the same as another <eg>&lt;l xml:id="jj17.423"&gt;&#xFEFF;I love rock n' roll&lt;/l&gt;
&lt;l&gt;So put another dime in the jukebox, baby&lt;/l&gt;
&lt;l sameAs="#jj17.423"&gt;I love rock n' roll&lt;/l&gt;
&lt;l&gt;So come an' take your time an' dance with me&lt;/l&gt;
</eg>
                </item><item><att>target</att> for cross-references, or
                  to indicate where a <gi>note</gi> is
                attached</item></list></item>
          </list>
        </slide>
      </section>
      <section>
        <head>Relative or Absolute URI</head>
        <slide>
          <p>Just as in XHTML: <list><label>absolute</label><item>a complete URI, including protocol (e.g.
                  <code>http://www.wwp.brown.edu/texts/index.html</code>)</item><label>relative</label><item>relative to the pointing element's
                  <soCalled>base</soCalled> URI, which is often
                the current document (e.g.
                <code>#appendix2</code>)</item></list>
          </p>
        </slide>
      </section>
      <section>
        <head>Simple Pointing Elements</head>
        <slide>
          <p>Two elements, <gi>ptr</gi> and <gi>ref</gi> are
            used for this task. The only difference is that
              <gi>ptr</gi> must be an empty element, whereas
              <gi>ref</gi> may have content.</p>
          <list>
            <label>
              <gi>ref</gi>
            </label>
            <item>provides both pointer and text (the
              style-sheet or other processor may ignore the
              text, of course); an example of referring to a web accessible XML file: <eg>For some context, see &lt;ref
target="http://www.example.com/extreme2004closing.xml"&gt;the
introduction&lt;/ref&gt;.</eg></item>
            <label>
              <gi>ptr</gi>
            </label>
            <item>provides only the pointer; the style-sheet or
              other processor has to generate text (or sound or
              whatever); an example of pointing to a local element (via its <att>xml:id</att>):
	    <eg>See &lt;ptr target="#chap08"/&gt;.</eg></item>
          </list>
        </slide>
      </section>
      <section>
        <head>Inclusion</head>
        <slide>
          <p>Take the contents of one file (the
            <soCalled>target</soCalled>,
            <soCalled>source</soCalled>, or
            <soCalled>included</soCalled> file) and include them as
            part of another (the <soCalled>driver</soCalled> or
              <soCalled>including</soCalled> file).</p>
          <list>
            <head>Reasons</head>
            <item>file management</item>
            <item>dynamically generate driver file from various
              source files</item>
            <item>boilerplate text</item>
            <item>reproduce without actually copying &amp;
              pasting (e.g., for web critic)</item>
            <item>stand-off markup</item>
          </list>
        </slide>
      </section>
      <section>
        <head>Mechanism</head>
        <slide>
          <list>
            <item>P5 uses W3C's <ref target="http://www.w3.org/TR/xinclude/">XInclude</ref> mechanism</item>
            <item>declare namespace on including element or
              ancestor: <eg>&lt;TEI xmlns="http://www.tei-c.org/ns/1.0"
     xmlns:xi="http://www.w3.org/2001/XInclude"&gt;</eg></item>
            <item>use inclusion element:
              <eg>&lt;xi:include href="http://www.here/it/is.xml"/&gt;</eg></item>
            <item>an <term>xinclude processor</term> reads in the
              driver file and replaces each <gi>xi:include</gi> with
              the element it points at</item>
          </list>
        </slide>
      </section>
      <section>
        <head>Consequences</head>
        <slide>
          <p>The driver TEI file should be well-formed, but will not
            typically be valid before xinclude processing.</p>
          <list>
            <item>Many XML software products, including <name>xmllint</name> and <name>oXygen</name>, will perform xinclude processing
              immediately before validation</item>
            <item>The TEI schemas can be customized to permit
                <gi>xi:include</gi> in a particular places in the
              hierarchy</item>
          </list>
        </slide>
      </section>
    </presentation>
  </text>
</TEI>
