Creation of abbreviation document
Created another simple XSLT file (below) to formalize the extraction of all distinct abbreviations used in the text, by creating a feature value library (<fvLib>). This is a valid TEI document that just requires that we complete the explanatory information for each of the abbreviations. I've captured about two thirds of that information already from the RET page, and will get together with Karin to complete the rest and add the information into the document.
The plan is to link this information to the actual abbreviations in the text, not through referencing with ids (which would involve editing the original text, something we are not able to do), but through XPath lookups based on the text of the abbreviations themselves. The effect should be the same, but we avoid the necessity to introduce ids and pointers and keep them in sync.
This is the XSLT used:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns="http://www.tei-c.org/ns/1.0">
<xsl:output method="xml" />
<xsl:template match="/" xpath-default-namespace="http://www.tei-c.org/ns/1.0"><xsl:text>
</xsl:text><TEI xmlns="http://www.tei-c.org/ns/1.0"><xsl:text>
</xsl:text><xsl:element name="teiHeader" xml:space="preserve">
<fileDesc>
<titleStmt>
<title>Feature structures used to document the use and expansion of abbreviations in the text</title>
<title><xsl:value-of select="count(distinct-values(//body//abbr[contains(., '{')]))" /> distinct abbr elements found which contain parentheses.</title>
<respStmt>
<resp>encoded/generated by</resp>
<name>Martin Holmes</name>
</respStmt>
</titleStmt>
<publicationStmt>
<p>Created by Martin Holmes, February 2007.</p>
</publicationStmt>
<sourceDesc>
<p></p>
</sourceDesc>
</fileDesc>
<encodingDesc>
<ab>
<!-- First create a feature value library we can put into another document. -->
<fvLib>
<xsl:for-each select="//body//abbr"><xsl:sort select="." /><xsl:variable name="TheAbbr" select="./text()" /><xsl:if test="not(preceding::abbr[text() = $TheAbbr])">
<fs>
<f name="abbr"><string><xsl:value-of select="$TheAbbr"/></string></f>
<f name="sample-expan"><string><xsl:value-of select="preceding-sibling::expan | following-sibling::expan"/></string></f>
<f name="explanation"><string></string></f>
</fs></xsl:if></xsl:for-each>
</fvLib>
</ab>
</encodingDesc>
</xsl:element>
<text>
<body>
<div>
<head>Feature library</head>
<p>This document contains the feature library for abbreviation/expansion information.</p>
<p>List of items:</p>
<div>
<xsl:for-each select="//body//abbr">
<xsl:sort select="." />
<xsl:variable name="TheAbbr" select="./text()" />
<xsl:if test="not(preceding::abbr[text() = $TheAbbr])"><p><xsl:copy-of select="./parent::choice" copy-namespaces="no" /><xsl:text>
</xsl:text>
<seg><xsl:value-of select="parent::node()/parent::node()" /></seg><xsl:text>
</xsl:text></p></xsl:if>
</xsl:for-each>
</div>
</div>
</body>
</text>
</TEI>
</xsl:template>
</xsl:stylesheet>
Work on this project is paused at this point, pending the institution of some method of hiding all our documentation behind passwords, because all the project info needs to be confidential.