<?tei:SOF p2aivc.odd ?>
<!-- P2.444 : Virtual Copies                                  -->
<!-- Revisions                                                -->
<!-- 93-06-03 : MSM : trivia                                  -->
<!-- 30 Mar 93 : LB   : renumber to AI                        -->
<!-- 02 Aug 92 : DTL  : Change one cross reference.           -->
<!-- 24 Jul 92 : DTL  : Make minor changes.                   -->
<!-- 21 Jul 92 : DTL  : Add warning about use of  < echo > .  -->
<!-- 19 Jul 92 : DTL  : Renumber section from p2.446 to p2.444. -->
<!--                    Complete first draft.                 -->
<!-- 16 Jul 92 : DTL  : Create  < tagList > ,  < dtdFrag >,   -->
<!--                    and TAGDOC.                           -->
<!--                                                          -->
 
<div2 name='Victor' id=AIVC><head>Virtual Copies</head>
 
<p>It is useful to be able to represent the fact that one segment of
text is identical to others, for analytical purposes, or (especially if
the segments are lengthy) to obviate the need for repeating the segment.
In section <xref type=div2 target=SAAG> several passages are cited
from George Orwell <title>Nineteen-Eighty-Four</title>, which include
two identical segments, giving the opening line of the character Winston
Smith's diary.  To indicate that they are the same, we may provide one
or both of the segments with an <att>equiv</att> attribute, which points
to the other segment, as in the following illustration, in which the
attribute is specified on the first occurrence.
 
<!-- From George Orwell, Nineteen-Eighty-Four.                     -->
<eg>
<![ CDATA [
<s type=orth-sent>In small clumsy letters he wrote: </s>
<p rendition='centered italic' id=D1>
<s type=orth-sent id=D1.1 equiv=d2.1>April 4th, 1984. </s>
<p><s type=orth-sent>He sat back. </s>
<s type=orth-sent>A sense of complete helplessness had descended upon
him. </s>
<!-- ... -->
<s type=orth-sent>His small but childish handwriting straggled up and
down the page, shedding first its capital letters and finally even its
full stops: </s>
<p rendition=italic id=D2>
<s type=orth-sent id=D2.1>April 4th, 1984. </s>
<s type=orth-sent id=D2.2>Last night to the flicks. </s>
]]>
</eg>
 
<p>All of the segments that are specified as equivalent using the
<att>equiv</att> attribute should have identical contents, except
possibly for <att>id</att> and other pointing attributes.  Thus the
<att>equiv</att> attribute can be used to encode equivalence of text
elements, but should not be used to avoid repeating the identical
content.  If avoiding having to repeat the content of an equivalent
segment is desired, the <gi>echo</gi> element can be used; its
description and attributes are as follows.
 
<tagList>
<tagDesc tagDoc=ECHO atts='what target'>
</tagList>
 
<!--  < p > To illustrate the use of the  < gi > echo < /gi   -->
<!-- >  tag, we repeat one of the passages from Beckett,  <   -->
<!-- title > Molloy < /title >  that is used as an            -->
<!-- illustration in section  < xref type=div3                -->
<!-- target=P2.23d1 > .                                       -->
The following example demonstrates the use of the <gi>echo</gi> element.
 
<eg>
<![ CDATA [
<s>Then I went back into the house and wrote,
<q who=moran><s>It is midnight.</s>
<s>The rain is beating on the windows.</s></q></s>
<s>It was not midnight.</s>
<s>It was not raining.</s>
]]>
</eg><!-- Samuel Beckett, Molloy, p. 241.       -->
 
<p>These are the last words of the novel.  The quoted section repeats
the opening of the second (and last) chapter of the book, which begins
as follows.
 
<!-- Ibid., p. 125.                                                -->
<eg>
<![ CDATA [
<p id=C2P1><s id=C2P1S1>It is midnight.</s>
<s id=C2P1S2>The rain is beating on the windows.</s>
<s>I am calm.</s>
]]>
</eg>
 
<p>To indicate that the two sentences which open the last chapter are
repeated right before the end of the book, one can encode the concluding
passage using the <gi>echo</gi> element as follows.
 
<!-- The id= VALUES are arbitrary; I do not know the actual number of
     paragraphs and segments that occur in the second chapter of Molloy!
                                                                   -->
<eg>
<![ CDATA [
<s id=C2P731S99>Then I went back into the house and wrote,
<q who=moran>
<analysis>
<echo id=C2P731S100 target=C2P1S1>
<echo id=C2P731S101 target=C2P1S2>
</analysis>
</q>
<s id=C2P731S102>It was not midnight.</s>
<s id=C2P731S103>It was not raining.</s>
]]>
</eg>
 
<p>The <gi>echo</gi> element must be used with caution, as it actually
replaces the content it represents.  The occurrence of <gi>echo</gi>
elements themselves is not problematic, as long as they are contained
within an <gi>analysis</gi> tag which, being an inclusion exception, is
allowed anywhere.  However, if those <gi>echo</gi> elements replace
elements which are required by the content model of the currently open
element, the result will be an SGML error.  The coding in the preceding
example is not problematic, since the content model for the <gi>q</gi>
element is <term>soup</term>, which does not contain any required
elements.
 
<p>In the preceding illustration, the <att>what</att> attribute of the
<tag>echo</tag> tag has the default value of <att>what=element</att>.
This means that the <tag>echo</tag> is to be understood as a virtual
copy of the entire element to which its <att>target</att> attribute
points.  Alternatively, we can specify <att>what=content</att> in the
<tag>echo</tag> tag, which means that the <tag>echo</tag> tag is to be
understood as a virtual copy of the content of the element to which its
<att>target</att> attribute points.  Thus the preceding example is
equivalent to the following.
 
<eg>
<![ CDATA [
<s id=C2P731S99>Then I went back into the house and wrote,
<q who=moran>
<s id=C2P731S100>
<analysis><echo what=content target=C2P1S1></analysis></s>
<s id=C2P731S101>
<analysis><echo what=content target=C2P1S2></analysis></s>
</q>
<s id=C2P731S102>It was not midnight.</s>
<s id=C2P731S103>It was not raining.</s>
]]>
</eg>
 
<p>The <gi>echo</gi> element together with the <att>exclude</att>
attribute provides for a very simple way of indicating that a passage
may occur in one of two different locations in a document.  Suppose that
a given passage identified as <tag>div2 id=MOBILE</tag> may appear
either immediately at the end of the first <tag>div1</tag> of the first
<tag>div0</tag> in a document, or at the beginning of the second
<tag>div1</tag>.  We could record the <tag>div2</tag> in its entirely in
the first of these positions, put an echo of it in the second, and set
pointers from each to the other using the <att>exclude</att> attribute
as follows.
 
<eg><![ CDATA [
<div0 id=D1> ...
<div1 id=D11> ...
<div2 id=MOBILE exclude=emobile> ...
<div1 id=D12>
<div2 id=EMOBILE exclude=mobile>
<analysis><echo what=content target=MOBILE></analysis>
]]>
</eg>
 
<p>The preceding example indicates that the two instances of the
repeated <tag>div2</tag> are mutually exclusive.  To indicate that the
first excludes the second but that the second does not exclude the first
(i.e., that the passage can appear either in the first position alone or
in both positions, but not in the second position alone), one simply
leaves off the <att>exclude=mobile</att> attribute on the second
occurrence.
 
<p>To indicate that the two occurrences are mutually exclusive but that
one chooses to represent the passage as occurring in one of the
positions, one can use the <att>select</att> attribute, on an element
that hierarchically encompasses the choices, as in the following
encoding, in which the second position for the movable <tag>div2</tag>
element is selected; note that the default setting of the
<att>what</att> attribute is used here for the <tag>echo</tag> tag.
This use of the <att>select</att> attribute together with
<att>exclude</att> attributes illustrates one of the methods of
disambiguation discussed further in chapter
<!-- not sure what this is a cross ref to-->
<xref type=div3 target=FS>.
<!-- and <xref type=div2 target=P2.449>. -->
 
<eg><![ CDATA [
<div0 id=D01 select=emobile>
<div1 id=D11> ...
<div2 id=MOBILE exclude=emobile> ...
<div1 id=D12>
<analysis><echo id=EMOBILE exclude=mobile target=MOBILE></analysis>
]]>
</eg>
 
<p>Here is the formal declaration of the <gi>echo</gi> element.
 
<dtdFrag id=DAIVC n=Echo>
<tagDecl tagDoc=ECHO>
</dtdFrag>
 
<?tei:EOF p2aivc.odd ?>
