<xdoc:doc>
<xdoc:short>Matches root (TEI|teiCorpus) and starts things off.</xdoc:short>
<xdoc:detail>By default, outputs full XHTML document. If $outputAsDiv is set to true, then
an HTML div is output.</xdoc:detail>
</xdoc:doc>
<xsl:template match="TEI|teiCorpus"><xsl:choose><xsl:when test="$outputAsDiv = true()"><div id="output-content"><xsl:call-template name="id"/><xsl:if test="$includeDocumentInformation = true()"><xsl:call-template name="docinfo"/></xsl:if><div><xsl:apply-templates/><xsl:call-template name="endnotes"/><xsl:if test="$displayThematicKeywords = true()"><xsl:call-template name="thematicKeywords"/></xsl:if></div></div></xsl:when><xsl:otherwise><html xmlns="http://www.w3.org/1999/xhtml"><!-- no id attribute on <html>. Need to stick id in a <meta> tag somewhere --><xsl:call-template name="htmlHead"/><body onload="init();"><div id="output-content"><xsl:if test="contains(/TEI/text/body/@rendition,'#wide')"><xsl:attribute name="style" select="'width:100%;'"/></xsl:if><xsl:if test="$includeDocumentInformation = true()"><xsl:call-template name="docinfo"/></xsl:if><xsl:if test="$includeDocHeader = true()"><xsl:call-template name="docHeader"/></xsl:if><!-- div included to validate poetry line groups which are spans and must have a parent div. --><div><xsl:apply-templates/><xsl:call-template name="endnotes"/><xsl:if test="$displayThematicKeywords = true()"><xsl:call-template name="thematicKeywords"/></xsl:if></div></div></body></html></xsl:otherwise></xsl:choose></xsl:template>
<xdoc:doc>
<xdoc:short>Transfers TEI @rendition values to XHTML @class values.</xdoc:short>
<xdoc:detail>This template assumes a specific encoding practice whereby TEI @rendition values are analagous to XHTML classes, a whitespace separated list of styles. The template accepts a "defaultRend" parameter passed in from the calling template. The default rendition values will be concatenated with the content of @rendition. So, for instance, the title template may have a defaultRend of "i" (for italics), which could then be combined with additional styles listed in @rendition, e.g., "u" (for underlined) or "b" (for bold).</xdoc:detail>
</xdoc:doc>
<xsl:template match="choice[orig]"><xsl:choose><xsl:when test="reg and ($regularizeOrig = true())"><xsl:apply-templates select="reg"/></xsl:when><xsl:otherwise><xsl:apply-templates select="orig"/></xsl:otherwise></xsl:choose></xsl:template>
Template
choice[@n='eol']
Documentation
<xdoc:doc>Handles choice between orig and reg. Assumes one child orig and one child reg. Special mode for end-of-line hyphenation. See also: template for "lb[n='eol']".</xdoc:doc>
<xsl:template match="title"><span><xsl:call-template name="rendition"><xsl:with-param name="defaultRend"><xsl:if test="not(@rendition) or @rendition=''"><xsl:value-of select="'i'"/></xsl:if></xsl:with-param></xsl:call-template><xsl:call-template name="id"/><xsl:call-template name="rend"/><xsl:apply-templates/></span></xsl:template>
Template
titlemulti-title
Documentation
<xdoc:doc>special mode to add a space between multiple title elements. E.g. in teiHeader one
might have title[@type='main'] followed by title[@type='sub'], and one wants at least a
space between these two title elements.</xdoc:doc>
<xdoc:doc>Handling of poetic stanzas. Special case for lg[@rend='sublg'], which represents a
"line group" within a stanza, that is not separated by white space from the recent of the
stanza, e.g., the octect and sestet within a Petrarchan sonnet or the four quatrains and
couplet in a Shakesperian sonnet.</xdoc:doc>
<xdoc:doc>
<xdoc:short>Handling of poetic lines</xdoc:short>
<xdoc:detail>Wraps poetic lines in a series of divs that, when combined with the proper CSS,
displays formated poetic lines with proper indentation (derived from l/@rend attributes)
and line numbering (derived from l/@n attributes.</xdoc:detail>
</xdoc:doc>
Template
docAuthor|s|seg|resp|emph|label|foreign|term|hi|quote[(contains(@rendition,'#sq')
or contains(@rendition,'#dq')) and not(@prev) and not(@next)]|q[(contains(@rendition,'#sq')
or contains(@rendition,'#dq')) and not(@prev) and not(@next)]
Documentation
<xdoc:doc>A generic template for (usually) inline elements.</xdoc:doc>
Description
Will, eventually, need special case for castList/castItem, when they are in "list" format.
Long quote predicate to avoide matching quotes with @prev and @next, which typically would appear in verse and are handled as a special case.
Namespace
No namespace
Match
docAuthor|s|seg|resp|emph|label|foreign|term|hi|quote[(contains(@rendition,'#sq')
or contains(@rendition,'#dq')) and not(@prev) and not(@next)]|q[(contains(@rendition,'#sq')
or contains(@rendition,'#dq')) and not(@prev) and not(@next)]
<xsl:template match="docAuthor|s|seg|resp|emph|label|foreign|term|hi|quote[(contains(@rendition,'#sq') or contains(@rendition,'#dq')) and not(@prev) and not(@next)]|q[(contains(@rendition,'#sq') or contains(@rendition,'#dq')) and not(@prev) and not(@next)]"><!-- |quote[parent::cit[contains(@rendition, '#block')]]--><xsl:choose><xsl:when test="((@rendition and @rendition != '') or (@rend and @rend != '') )"><span><xsl:call-template name="atts"/><xsl:apply-templates/></span></xsl:when><xsl:otherwise><span><xsl:attribute name="class"><xsl:value-of select="name()"/></xsl:attribute><xsl:call-template name="id"/><xsl:apply-templates/></span></xsl:otherwise></xsl:choose></xsl:template>
Template
author|speaker|bibl|cit|w|c|publisher|titlePart|catDesc|castItem|title[@level = 'a'
and contains(@rendition,'#nq')]|l[contains(@rendition,'#inline')]
Namespace
No namespace
Match
author|speaker|bibl|cit|w|c|publisher|titlePart|catDesc|castItem|title[@level = 'a'
and contains(@rendition,'#nq')]|l[contains(@rendition,'#inline')]
Template
q|soCalled|title[contains(@rendition,'#quotes')]|title[@level='a' and not(contains(@rendition,'#dq'))
and not(contains(@rendition,'#sq')) and not(contains(@rendition,'#nq'))]|analytic/title[not(contains(@rendition,'#dq'))]|quote[not(parent::cit[contains(@rendition,'#block')])
and not(contains(@rendition,'#block'))]
Namespace
No namespace
Match
q|soCalled|title[contains(@rendition,'#quotes')]|title[@level='a' and not(contains(@rendition,'#dq'))
and not(contains(@rendition,'#sq')) and not(contains(@rendition,'#nq'))]|analytic/title[not(contains(@rendition,'#dq'))]|quote[not(parent::cit[contains(@rendition,'#block')])
and not(contains(@rendition,'#block'))]
<xsl:template match="q|soCalled|title[contains(@rendition,'#quotes')]|title[@level='a' and not(contains(@rendition,'#dq')) and not(contains(@rendition,'#sq')) and not(contains(@rendition,'#nq'))]|analytic/title[not(contains(@rendition,'#dq'))]|quote[not(parent::cit[contains(@rendition,'#block')]) and not(contains(@rendition,'#block'))]"><span><xsl:call-template name="atts"/><xsl:call-template name="quotes"><xsl:with-param name="contents"><xsl:apply-templates/></xsl:with-param></xsl:call-template></span></xsl:template>
<xsl:template match="soCalled[contains(@rendition,'#sq') or contains(@rendition,'#dq')]"><xsl:param name="rendition"><xsl:value-of select="translate(translate(normalize-space(@rendition), '#sq', ''), '#dq', '')"/></xsl:param><span><xsl:call-template name="id"/><xsl:call-template name="rend"/><!-- insteading of calling "rendition" template, need to remove #sq --><xsl:if test="$rendition != ''"><xsl:attribute name="class"><xsl:value-of select="translate(normalize-space($rendition), '#', '')"/></xsl:attribute></xsl:if><xsl:choose><xsl:when test="contains(@rendition,'#sq')"><xsl:text>‘</xsl:text></xsl:when><xsl:when test="contains(@rendition,'#dq')"><xsl:text>“</xsl:text></xsl:when></xsl:choose><xsl:apply-templates/><xsl:choose><xsl:when test="contains(@rendition,'#sq')"><xsl:text>’</xsl:text></xsl:when><xsl:when test="contains(@rendition,'#dq')"><xsl:text>”</xsl:text></xsl:when></xsl:choose></span></xsl:template>
Template
lg/l[position() = 1]//q[@next and @prev]
Documentation
<xdoc:doc>
<xdoc:short>Special quotation</xdoc:short>
<xdoc:detail>This template matches part of an extended quotation, the first line of a new stanza. In Swinburne,
these lines have an initial double quotation mark.</xdoc:detail>
</xdoc:doc>
<xsl:template match="date"><xsl:choose><xsl:when test="$tooltipDates = true()"><xsl:choose><!-- test for attribute and that attribute containts more that
a four-digit year --><xsl:when test="(@when | @from | @to)"><xsl:choose><xsl:when test="name() = 'date'"><span class="tooltip" onmouseout="hideTip()"><xsl:call-template name="atts"/><xsl:attribute name="onmouseover"><xsl:text>doTooltip(event,'</xsl:text><xsl:value-of select="@when"/><xsl:text>')</xsl:text></xsl:attribute><xsl:apply-templates/></span></xsl:when><!-- dateRange --><xsl:otherwise><span class="tooltip" onmouseout="hideTip()"><xsl:call-template name="atts"/><xsl:attribute name="onmouseover"><xsl:text>doTooltip(event,'<div></xsl:text><xsl:value-of select="$headerFrom"/><xsl:text></xsl:text><xsl:value-of select="@from"/><xsl:text><br/></xsl:text><xsl:value-of select="$headerTo"/><xsl:text></xsl:text><xsl:value-of select="@to"/><xsl:text>')</xsl:text></xsl:attribute><xsl:apply-templates/></span></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><span><xsl:call-template name="atts"/><xsl:apply-templates/></span></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><span><xsl:call-template name="atts"/><xsl:choose><!-- if date or dateRange is empty, then display @value or @from and @to --><xsl:when test="not(child::*) and not(text())"><xsl:choose><xsl:when test="name() = 'date'"><xsl:value-of select="@when"/></xsl:when><xsl:otherwise><xsl:value-of select="@from"/><xsl:text> — </xsl:text><xsl:value-of select="@to"/></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:apply-templates/></xsl:otherwise></xsl:choose></span></xsl:otherwise></xsl:choose></xsl:template>
match
<xsl:template match="*">
<xsl:message>
<xsl:value-of select="concat(name(),': ')"/> ELEMENT UNACCOUNTED FOR BY STYLESHEET:
</xsl:message>
<xsl:apply-templates/>
</xsl:template>