Skip to content

Instantly share code, notes, and snippets.

@benwbrum
Last active July 4, 2020 15:52
Show Gist options
  • Save benwbrum/081613b35b67e7831b55e2efbf232910 to your computer and use it in GitHub Desktop.
Save benwbrum/081613b35b67e7831b55e2efbf232910 to your computer and use it in GitHub Desktop.
Coverage of different tags in CWG-K documents as of 2020-07-03

<!-- add line break for each <lb> -->

   <xsl:template match="tei:lb">
    <xsl:apply-templates/><br />
  </xsl:template>

Done

<!-- replace hi tags with html tags -->

  <xsl:template match="tei:hi">
    <xsl:choose>
			<xsl:when test="@rend='sup'">
        <sup><xsl:apply-templates/></sup>
			</xsl:when>
      <xsl:when test="@rend='sub'">
        <sub><xsl:apply-templates/></sub>
      </xsl:when>
      <xsl:when test="@rend='italic'">
        <em><xsl:apply-templates/></em>
      </xsl:when>
      <xsl:when test="@rend='bold'">
        <strong><xsl:apply-templates/></strong>
      </xsl:when>
      <xsl:when test="@rend='underline'">
        <span style="text-decoration:underline;"><xsl:apply-templates/></span>
      </xsl:when>
      <xsl:when test="@rend='str'">
        <strike><xsl:apply-templates/></strike>
      </xsl:when>
    </xsl:choose>
  </xsl:template>

Done

<!-- wrap notes with greater than and less than characters -->

<xsl:template match="tei:note">
    <xsl:choose>
      <xsl:when test="@place='header'">
        <xsl:text>&lt; </xsl:text>
        <xsl:apply-templates/>
        <xsl:text> &gt;</xsl:text>
      </xsl:when>
      <xsl:when test="@place='footer'">
        <xsl:text>&lt; </xsl:text>
        <xsl:apply-templates/>
        <xsl:text> &gt;</xsl:text>
      </xsl:when>
      <xsl:when test="@place='body'">
        <xsl:text>&lt; </xsl:text>
        <xsl:apply-templates/>
        <xsl:text> &gt;</xsl:text>
      </xsl:when>
      <xsl:when test="@place='stamp'">
        <xsl:text>&lt; </xsl:text>
        <xsl:apply-templates/>
        <xsl:text> &gt;</xsl:text>
      </xsl:when>
      <xsl:when test="@place='left margin'">
        <xsl:text>&lt;&lt; </xsl:text>
        <xsl:apply-templates/>
        <xsl:text> &gt;</xsl:text>
      </xsl:when>
      <xsl:when test="@place='right margin'">
        <xsl:text>&lt; </xsl:text>
        <xsl:apply-templates/>
        <xsl:text> &gt;&gt;</xsl:text>
      </xsl:when>
    </xsl:choose>
  </xsl:template>

Coverage

KYR-0001-001-0009.xml:<p><note place="header">2</note></p>
KYR-0001-003-0044.xml:   <p><note place="header">X Frank P Cotton</note>
KYR-0001-003-0044.xml:<p>Suffice it to say -- that I have Just returned from Washington Cty -- where I visited -- for the sole purpose of relieving a youthful half brother from the Military prison at Camp Douglas.<note place="right margin">X</note></p>
KYR-0001-003-0090.xml:   <p><note place="header"><hi rend="underline">Copy</hi></note>
KYR-0001-003-0098.xml:<lb/><note place="footer">over.</note><pb/>
KYR-0001-004-0029.xml:<p>A Copy Test <persName ref="cwgk:N00004890">L L Cooke</persName> C W E &amp; C C<lb/><stamp type="revenue"/><note place="stamp">L L C
KYR-0001-004-0131.xml:<lb/><note place="left margin">* when Levi had finished putting the poison on the meat he handed the paper to his wife, (in Caroline<hi rend="sup">s</hi> presence) folded &amp; tied neatly as if just from the Druggists- <hi rend="str">who</hi> ^mrs Levi^ put it in the bottom of the till of a trunk in the room &amp; placed upon the paper a small empty paper box- 2 inches long by one inch broad, (about the size of the paper in which the poison was) &amp; on the top of the box she carelessly laid some artificial flowers- these were all the articles in this part of the till of the trunk -- the till being divided into apartments like little boxes The ^trunk^ as it always did remained unlocked &amp; unstrapped.</note></p>
KYR-0001-004-0131.xml:<p><note place="left margin">4</note>During his absence Caroline was not disobedient or insolent but was surly, rather pouting &amp; silent doing her work as usual -- <pb/>
KYR-0001-004-0131.xml:<p><note place="footer">(Mrs Levi further stated on cross-ex. that since She examined the paper of poison on Tuesday evening it had not been opened or retied -- &amp; upon its being presented to her ^in court^ said it was not tied badly.) com atty</note><pb/>
KYR-0001-004-0796.xml:<lb/><note place="right margin">Of the Jury</note>
KYR-0001-004-2991.xml:<p><milestone unit="column" n="1"/><note place="left margin">Bath Cir Ct
KYR-0001-004-2992.xml:<lb/><milestone unit="column" n="1"/><note place="right margin">P, O, Hamilton</note></p>
KYR-0001-020-0034.xml:    <note type="editorial">Scanned image flawed due to leaves being pasted together. Text partially recoverable.</note>
KYR-0001-020-0080.xml:    <note type="editorial">Leaves MG17A-114 to MG17A-115 separated in archive. Restored in this record.</note>
KYR-0002-009-0007.xml:<p><note place="body">1.2. 3</note><pb/></p>
KYR-0002-222-0062.xml:<note place="body"><p>no transportation was supplied to this Regiment</p>

<!-- replace gap with [ ] -->

  <xsl:template match="tei:gap">
    <xsl:text>[ ]</xsl:text>
  </xsl:template>

Coverage

KYR-0001-001-0013.xml:<p>§ 2. That whenever a perso<unclear/> called on to exercise an<unclear/> or legal rights and privileg<unclear/> citizens of Kentucky, he may be<unclear/> tive on oath the expatriation provided <unclear/> section of this act; and upon his failure <unclear/>sal to do so, shall not be permitted to exerci <gap/> such right or privilege.</p>
KYR-0001-002-0019.xml:<lb/>Frankfort, <gap/> 186<gap/>.</p>
KYR-0001-003-0007.xml:   <p>NO. 13, (ABSTRACT <gap/>.)
KYR-0001-003-0033.xml:<p>you See from the Draught on forth page that the cilendars are Roled with a cog wheel, I have left off the top plate, so that you could <gap/> See its inside</p>
KYR-0001-003-0043.xml:<lb/><hi rend="str">CHICAGO, ILLS., <gap/> 1864</hi>.
KYR-0001-003-0090.xml:<p>Can you not put a force of 200. or 300. men at Several different points to curb and Keep in check the almost rampant Secessionists there: -- say at Brandenburg -- Hawesville <gap/> &amp; Henderson wih instructions to clear the back county of all guerillas and rebel recruiting parites</p>
County was indicted for larceny at the <gap/> <date when="1860">term of the Lyon Circuit Court. for 1860</date>. They state that they are informed &amp; believe that said Braswell made his appearance in said Court. at the <date when="1860-06">June term of 1860</date> but arrived one day too late. and his bond was taken as forfeited They say that. they are informed &amp; believe that said Braswell was in error, as to the week in which the Court commenced. that he arrived on tuesday supposing the term commen^c^ed on the following monday, whereas the bond was taken as forfeited the preceeding day.</p>
KYR-0001-004-0704.xml:<p>The Said John Eirwin &amp; Isaac Vertrees, not being Physicians on the <gap/> day of <date when="1861-10">October 1861</date> Son divers days since, in the County afsd did give, loan &amp; Sell Spiritous, Malt &amp; Vinious Liquors to Henry a Slave, &amp; the property Philip Hicks, and they Sd Eirwin &amp; Vertrees, not having then &amp; there Said Slave under their Controll<pb/></p>
KYR-0001-004-0728.xml:<p>The undersigned your petitioners would Respectfully Represent to your Excellency that at <gap/> term of the Owen Circuit Court John Howard a free man of Colour was indicted and fined in the sum of Sixty dollars for keeping a tipling house in said County.</p>
KYR-0001-004-1804.xml:<p>Your petitioner Michal, would respectfully states that on the <date when="1865-05-03">3<hi rend="underline"><hi rend="sup">rd</hi></hi> day of may 1865</date> being at the <date when="1865-05">May Term</date> of the City Court of Louisville he was fined fifty Dollars with costs on a charge of an Assault &amp; Battery on one Jacob Apple the facts briefly, stated are as follows one day in <gap/> <date when="1865">1865</date> the two children of your petitioner aged three &amp; 6 years were struck across the hands with a stick by a daughter of the prosecuting witnes aged fourteen years, which left a red mark on there hands, the first time your petitioner met said Apple he told him that he did not want his children whipt any more, and as the saying is one word brought on an other until said Jacob Apple threw a bucket full of wather upon your petitioner thereby commencing the assault himself afterwards several blowes passed between them, neither of them was much hurt, and one about as much as the other said Apple then had him Indided, and he was the only witness by whom any thing conserning the case was proved, now if your petitioner could have testified the case would have been the reverse from what it was, your petitioner say that he is a poor man with wife and three children<pb/>
KYR-0004-033-0036.xml:<p>Mr H. W. Bruce offered the following amendment to the substitute Towit: "The Governor is also authorized to receive in the same manner, One or more Companies of Artillery to consist of not less than <gap/> men nor more than <gap/> men

<!-- replace <unclear>some text</unclear> with [some text] and <unclear /> with [...] -->

  <xsl:template match="tei:unclear">
    <xsl:choose>
      <xsl:when test="string-length(.) &gt; 0">
        <xsl:text>[</xsl:text>
        <xsl:apply-templates/>
        <xsl:text>]</xsl:text>
      </xsl:when>
      <xsl:otherwise>
        <xsl:text>[...]</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

Coverage

KYR-0001-001-0012.xml:<p>The Constitution declares that, "every free white MALE CITIZEN of the age of 2<unclear/> years, who has resided in the State two years; or in the county, town, or city, in which he offers to vote, one year next preceding the election, shall be a voter; but such voter shall have been, for sixty days next preceding the election, a resident of the precinct in which he offers to vote, and he shall vote in said precinct, and not elsewhere."</p>
KYR-0001-001-0012.xml:<p>§ 1. <hi rend="italic">Be it enacted by the General Assembly of the Commonwealth of Kentucky</hi>, That any citizen of this State who shall enter into the service of the so-called Confederate States, in either a civil or military capactiy or into the service of the so-called Provisional Government of Kentucky, in either a civil or military capacity, or having heretofore entered such service of either the Confederate States or Provisional Government, shall continue in such service after this act takes effect, or shall take up or continue in arms against the military forces of the United States or the State of Kentucky, or shall give voluntary aid and assistance to those in arms against said forces shall be deemed to have expatriated himself <unclear/> <hi rend="italic">shall no longer be a citizen of Kentucky,</hi> <unclear/> <hi rend="italic">he again be a citizen, except by permis </hi><unclear/> <hi rend="italic">Legislature</hi>, by a general or specia <unclear/></p>
KYR-0001-003-0001.xml:	<cell>200<unclear/></cell>
KYR-0001-003-0001.xml:<p>I have Copy <unclear>present</unclear> for office</p>
KYR-0001-003-0034.xml:<lb/>Mr. <unclear>Hagain</unclear> </p>
KYR-0001-003-0034.xml:<p>I have not Shown the Small <unclear/> work, as you might not understand it,</p>
KYR-0001-004-0240.xml:<lb/><unclear>P<hi rend="sup">r</hi> S</unclear> Champagne
KYR-0001-004-0240.xml:<lb/>Manria M<unclear>urra</unclear><milestone unit="column" n="1"/><pb/></p>

<!-- figure: hr, postmark, seal -->

<xsl:template match="tei:figure">
    <xsl:choose>
      <xsl:when test="@type='seal'">
        <xsl:choose>
          <xsl:when test="string-length(.) &gt; 0">
            <xsl:text>{</xsl:text>
            <xsl:apply-templates/>
            <xsl:text>}</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>{Seal}</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>
      <xsl:when test="@type='postmark'">
        <xsl:choose>
          <xsl:when test="string-length(.) &gt; 0">
            <xsl:text>{</xsl:text>
            <xsl:apply-templates/>
            <xsl:text>}</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>{Postmark}</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>
      <xsl:when test="@type='hr'">
        <xsl:apply-templates/><hr />
      </xsl:when>
    </xsl:choose>
  </xsl:template>

Coverage -- HR

KYR-0001-001-0013.xml:   <p>PROCLAMATION.<figure type="hr"/>
KYR-0001-002-0003.xml:<p>Q<hi rend="sup">r</hi>. M<hi rend="sup">r</hi>. General<figure type="hr"/>
KYR-0001-002-0019.xml:<lb/><date when="1865-01-30">Jany. 30<hi rend="sup">th</hi> 1865</date><figure type="hr"/>
KYR-0001-002-0019.xml:<lb/>Webb I. N.<figure type="hr"/></p>

Coverage -- Seal

KYR-0001-004-0342.xml:<p><figure type="seal"><ab>E. E. M<hi rend="underline"><hi rend="sup">c</hi></hi>KAY
KYR-0001-004-0375.xml:<lb/><figure type="seal"><ab>NOTORIAL
KYR-0001-004-0427.xml:<p>Jos Hennin <figure type="seal"/>
KYR-0001-004-0721.xml:<lb/><figure type="seal"/></p>
KYR-0001-004-0791.xml:<p>The undersigned petitioner respectfully sheweth that at the <date when="1863-12">December term 1863</date>. of the Kenton Circuit Court he was fined <hi rend="underline">$50</hi>, on <hi rend="underline">three several Indictments</hi> numbered respectively <hi rend="underline">782</hi>-<hi rend="underline">783</hi> &amp; <hi rend="underline">785</hi>, for <hi rend="underline">selling liquor to minors</hi>. The 1<hi rend="sup">st</hi> he repleived <date when="1863-12-30">Dec 30/63</date> the 2<hi rend="sup">d</hi> he replieved the same day. and the 3<hi rend="sup">d</hi> he replieved <date when="1864-01-12">Jany 12/64</date>. He has always been an honorable man and tried to <figure type="seal"/> keep <unclear/> biding house_ but these were th<unclear/> young men, working in a <unclear/> near his Coffee House who <hi rend="underline">leaked, <unclear/>eased to be over twenty one years of age</hi>_ they were doing business for themselves- made their own contracts- and were to all intents and purposes acting for themselves. One of them lacked but a few months of being 21. All were grown-and to a person-not related to them- they had all the actions and appearance of adult men- and upon their testimony he was convicted-upon the instigation of one <hi rend="underline">John Beasly</hi>, who became offended, because affiant attempted to collect from him a small liquor bill. Affiant<pb/>

Coverage -- Postmark

KYR-0001-004-2472.xml:<lb/><stamp type="postage"/><figure type="postmark"><ab>BOWLI<unclear>NG</unclear> GREEN
KYR-0001-004-2472.xml:<lb/><figure type="postmark"/></p>

<!-- stamps -->

  <xsl:template match="tei:stamp">
    <xsl:choose>
      <xsl:when test="@type='revenue'">
        <xsl:text>{Revenue Stamp}</xsl:text>
      </xsl:when>
      <xsl:when test="@type='postage'">
        <xsl:text>{Postage Stamp}</xsl:text>
      </xsl:when>
      <xsl:when test="@type='clerical'">
        <xsl:text>{Clerical Stamp}</xsl:text>
      </xsl:when>
    </xsl:choose>
  </xsl:template>

Coverage -- Stamp

KYR-0001-004-0551.xml:<p><stamp type="revenue"/><note place="stamp">J C
KYR-0001-004-0557.xml:   <p><stamp type="revenue"/><note place="stamp"><date when="1864"><unclear/>1864</date></note></p>
KYR-0002-038-0024.xml:<lb/><stamp type="postage"/><figure type="postmark"/></p>
KYR-0001-020-0792.xml:   <p><stamp/>Bowling Green Ky
KYR-0001-020-0794.xml:   <p><stamp/>To His Excellency B. Magoffin
KYR-0002-222-0029.xml:<p><stamp type="clerical">THIRD AUDITOR'S

<!-- tables -->

<xsl:template match="tei:table">
   <table><xsl:apply-templates/></table>
  </xsl:template>

  <xsl:template match="tei:row">
   <tr><xsl:apply-templates/></tr>
  </xsl:template>

  <xsl:template match="tei:cell">
   <td><xsl:apply-templates/></td>
  </xsl:template>

	<xsl:template match="eg:egXML">
		<xsl:element name="{local-name()}">
			<xsl:apply-templates select="@*"/>

			<xsl:call-template name="xml-to-string">
				<xsl:with-param name="node-set">
					<xsl:copy-of select="node()"/>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>

Coverage

KYR-0001-028-0006.xml:<p>I have issued &amp; delivered the following Commissions viz:<table rend="rules">
KYR-0001-028-0006.xml:<lb/><table rend="rules">
KYR-0001-028-0007.xml:<lb/><table rend="rules">

<!-- add a white space in empty milestone so it doesn't wrap around other elements -->

  <xsl:template match="tei:milestone">
    <xsl:variable name="milenum" select="@n" />
   <milestone>
     <xsl:attribute name="n">
       <xsl:value-of select="$milenum" />
     </xsl:attribute>
     <xsl:text> </xsl:text>
   </milestone>
  </xsl:template>

Coverage

KYR-0001-004-0394.xml:<lb/>Thomas Stone<milestone unit="column" n="1"/><pb/></p>
KYR-0001-004-0396.xml:<p><milestone unit="column" n="2"/><cb n="1"/>Names

<!-- wrap content following cb elements in a div, with a class indicating the number of columns in the preceding milestone n attribute (if milestone n=2, then div class=column1of2 or div class=column2of2) -->

  <xsl:template match="tei:p[tei:cb]">
    <xsl:choose>
      <xsl:when test="count(tei:cb) = number(tei:cb/preceding::tei:milestone/@n)">
        <div>
          <xsl:if test="preceding-sibling::tei:p[tei:cb]">
            <xsl:attribute name="class">teip</xsl:attribute>
          </xsl:if>
          <xsl:apply-templates/>
        </div>
      </xsl:when>
      <xsl:otherwise>
        <xsl:apply-templates/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
    <xsl:variable name="milenum" select="preceding::tei:milestone/@n" />
    <xsl:variable name="className" select="concat('column', @n, 'of', $milenum)" />
    <xsl:if test="not(@n = '1')"> <!-- if it's not the first, close the tag for the previous one -->
      <xsl:text disable-output-escaping="yes">&lt;/div&gt;</xsl:text>
    </xsl:if>
    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>div class="<xsl:value-of select="$className"/>"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
  </xsl:template>

  <!-- wrap the nodes following the last milestone element in a div, with a class indicating the number of columns (if milestone n=1, then div class=column1) -->
  <xsl:template match="tei:milestone">
    <xsl:if test="@n = '1' and preceding::tei:cb[@n]">
      <xsl:text disable-output-escaping="yes">&lt;/div&gt;</xsl:text>
    </xsl:if>
  </xsl:template>

  <xsl:template match="tei:pb">
   <pb>
     <xsl:text> </xsl:text>
   </pb>
  </xsl:template>

	<xsl:template match="eg:egXML//comment()">
		<xsl:comment><xsl:value-of select="."/></xsl:comment>
	</xsl:template>

  <xsl:template match="tei:persName | tei:orgName | tei:placeName ">
    <a href="{substring(@ref, 6)}"><xsl:value-of select='.'/></a>
  </xsl:template>

Coverage

KYR-0001-003-0145.xml:<lb/><cb n="5"/>Shepard, A., 31 Front st
KYR-0001-004-0002.xml:<p><milestone unit="column" n="2"/><cb n="1"/>Allen. T. Shea.

KYR-0001-001-0005.xml:<p>THOS. E. BRAMLETTE, <hi rend="italic">Governor of Kentucky</hi>.<pb/></p>
KYR-0001-001-0006.xml:<lb/><hi rend="italic">Governor of Kentucky</hi>.<pb/></p>
KYR-0001-001-0007.xml:<lb/>E. L. VANWINKLE, <hi rend="italic">Secretary of State</hi>.<pb/></p>
KYR-0001-001-0009.xml:<p>The first section of the act provides, "That the Governor of the State of Kentucky, by the consent and under the direction of the President of the United States, shall have power to raise and organize into regiments a volunteer force, not exceeding twenty thousand rank and file, to be raised within the State of Kentucky, to serve for the term of twelve months, to be employed within the limits of Kentucky in repelling invasion, suppressing insurrection, and guarding and protecting the public property : <hi rend="italic">Provided</hi>, That at any time it may be necessary, in the discretion of the President of the United States, these troops may be employed out of the limits of Kentucky, against the enemies of the United States."<pb/></p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment