Mode:

Compact lists

Showing:

Documentation
Parameters
Used by
References
Supersedes
Included from
Source
Stylesheet html_core.xsl
Documentation

Description

TEI stylesheet dealing with elements from the core module, making HTML output.

This software is dual-licensed: 1. Distributed under a Creative Commons Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 2. http://www.opensource.org/licenses/BSD-2-Clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Author: See AUTHORS

Copyright: 2013, TEI Consortium


Description

      <xsl:when test="$value='quoted'">
        <xsl:text>‘</xsl:text>
        <xsl:call-template name="applyRend">
          <xsl:with-param name="value" select="$rest"/>
        </xsl:call-template>
        <xsl:text>’</xsl:text>
      </xsl:when>
      <xsl:when test="$value='interlinMarks'">
        <xsl:text>`</xsl:text>
        <xsl:call-template name="applyRend">
          <xsl:with-param name="value" select="$rest"/>
        </xsl:call-template>
        <xsl:text>´</xsl:text>
      </xsl:when>
Included from
Stylesheet version 3.0
Template tei:ab
Documentation

Description

Process element ab
Namespace No namespace
Match tei:ab
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:ab">
  <xsl:choose>
    <xsl:when test="ancestor::tei:head or parent::tei:title or parent::tei:stage">
      <xsl:apply-templates/>
      <xsl:if test="following-sibling::tei:ab">
        <br/>
      </xsl:if>
    </xsl:when>
    <xsl:when test="parent::tei:sp">
      <div>
        <xsl:if test="@xml:id">
          <xsl:call-template name="makeAnchor"/>
        </xsl:if>
        <xsl:call-template name="makeRendition">
          <xsl:with-param name="default">spProse</xsl:with-param>
        </xsl:call-template>
        <xsl:apply-templates/>
      </div>
    </xsl:when>
    <xsl:otherwise>
      <div>
        <xsl:if test="@xml:id">
          <xsl:call-template name="makeAnchor"/>
        </xsl:if>
        <xsl:call-template name="makeRendition">
          <xsl:with-param name="default">false</xsl:with-param>
        </xsl:call-template>
        <xsl:if test="@type">
          <xsl:attribute name="class">
            <xsl:sequence select="@type"/>
            <xsl:if test="@subtype">
              <xsl:sequence select="' '||@subtype"/>
            </xsl:if>
          </xsl:attribute>
        </xsl:if>
        <xsl:apply-templates/>
      </div>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:addrLine
Documentation

Description

Process element addrLine
Namespace No namespace
Match tei:addrLine
Mode #default
Import precedence 14
Source
<xsl:template match="tei:addrLine">
  <xsl:apply-templates/>
  <br/>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:address
Documentation

Description

Process element address
Namespace No namespace
Match tei:address
Mode #default
References
Template
Import precedence 14
Source
<xsl:template match="tei:address">
  <span class="address">
    <xsl:call-template name="makeRendition"/>
    <xsl:apply-templates/>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:author
Documentation

Description

Process element author
Namespace No namespace
Match tei:author
Mode #default
References
Template
Import precedence 14
Source
<xsl:template match="tei:author">
  <span>
    <xsl:call-template name="makeRendition"/>
    <xsl:apply-imports/>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:change
Documentation

Description

Process element change
Namespace No namespace
Match tei:change
Mode #default
Import precedence 14
Source
<xsl:template match="tei:change">
  <tr>
    <td style="vertical-align:top;" width="15%">
      <xsl:value-of select="tei:date"/>
    </td>
    <td width="85%">
      <xsl:value-of select="tei:item"/>
    </td>
  </tr>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:choiceplain
Documentation

Description

Process element choice in plain mode - selects "critical" reading.
Namespace No namespace
Match tei:choice
Mode plain
Import precedence 14
Source
<xsl:template match="tei:choice" mode="plain">
  <xsl:value-of select="tei:reg"/>
  <xsl:value-of select="tei:expan"/>
  <xsl:value-of select="tei:corr"/>
  <xsl:apply-templates select="tei:choice"/>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:cit
Documentation

Description

Process element choice

Description

Process element cit

Namespace No namespace
Match tei:cit
Mode #default
References
Function
Template
Parameter
Import precedence 14
Source
<xsl:template match="tei:cit">
  <xsl:choose>
    <xsl:when test="(tei:match(@rend,'display') and tei:quote) or                       tei:quote/tei:l or tei:quote/tei:p">
      <div>
        <xsl:call-template name="makeRendition">
          <xsl:with-param name="auto">cit</xsl:with-param>
        </xsl:call-template>
        <xsl:if test="@xml:id">
          <xsl:attribute name="id">
            <xsl:value-of select="@xml:id"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="@n">
          <xsl:text>(</xsl:text>
          <xsl:value-of select="@n"/>
          <xsl:text>) </xsl:text>
        </xsl:if>
        <xsl:apply-templates select="tei:q|tei:quote"/>
        <xsl:apply-templates select="tei:*[not(self::tei:q or self::tei:quote)]"/>
      </div>
    </xsl:when>
    <xsl:when test="tei:match(@rend,'display')">
      <blockquote>
        <xsl:call-template name="makeRendition"/>
        <xsl:variable name="contents">
          <xsl:if test="@n">
            <xsl:text>(</xsl:text>
            <xsl:value-of select="@n"/>
            <xsl:text>) </xsl:text>
          </xsl:if>
          <xsl:apply-templates select="tei:q|tei:quote"/>
          <xsl:apply-templates select="tei:*[not(self::tei:q or self::tei:quote)]"/>
        </xsl:variable>
        <xsl:choose>
          <xsl:when test="$outputTarget=('html5', 'html')">
            <xsl:copy-of select="$contents"/>
          </xsl:when>
          <xsl:otherwise>
            <p>
              <xsl:copy-of select="$contents"/>
            </p>
          </xsl:otherwise>
        </xsl:choose>
      </blockquote>
    </xsl:when>
    <xsl:when test="tei:bibl">
      <span>
        <xsl:call-template name="makeRendition"/>
        <xsl:if test="@n">
          <xsl:text>(</xsl:text>
          <xsl:value-of select="@n"/>
          <xsl:text>) </xsl:text>
        </xsl:if>
        <xsl:apply-templates/>
      </span>
    </xsl:when>
    <xsl:otherwise>
      <div>
        <xsl:call-template name="makeRendition"/>
        <xsl:if test="@n">
          <xsl:text>(</xsl:text>
          <xsl:value-of select="@n"/>
          <xsl:text>) </xsl:text>
        </xsl:if>
        <xsl:apply-templates/>
      </div>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:code
Documentation

Description

Process element code
Namespace No namespace
Match tei:code
Mode #default
References
Template
Import precedence 14
Source
<xsl:template match="tei:code">
  <code>
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="default">false</xsl:with-param>
    </xsl:call-template>
    <xsl:apply-templates/>
  </code>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:date
Documentation

Description

Decorate date
Namespace No namespace
Match tei:date
Mode #default
References
Template
Import precedence 14
Source
<xsl:template match="tei:date">
  <span>
    <xsl:call-template name="makeRendition"/>
    <xsl:apply-imports/>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:eg
Documentation

Description

Process element eg
Namespace No namespace
Match tei:eg
Mode #default
References
Parameter
Import precedence 14
Source
<xsl:template match="tei:eg">
  <xsl:variable name="myID">
    <xsl:apply-templates select="." mode="ident"/>
  </xsl:variable>
  <pre id="{$myID}">
    <xsl:if test="$cssFile">
      <xsl:attribute name="class">
        <xsl:text>pre_eg</xsl:text>
        <xsl:if test="not(*)">
          <xsl:text> cdata</xsl:text>
        </xsl:if>
      </xsl:attribute>
    </xsl:if>
    <xsl:apply-templates/>
    <a href="#{$myID}" class="anchorlink">
      <xsl:text></xsl:text>
    </a>
  </pre>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:emph
Documentation

Description

Process element emph
Namespace No namespace
Match tei:emph
Mode #default
References
Template
Import precedence 14
Source
<xsl:template match="tei:emph">
  <em>
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="default">false</xsl:with-param>
    </xsl:call-template>
    <xsl:apply-templates/>
  </em>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:distinct
Documentation

Description

Process element distinct
Namespace No namespace
Match tei:distinct
Mode #default
References
Template
Import precedence 14
Source
<xsl:template match="tei:distinct">
  <span>
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="default" select="local-name()"/>
    </xsl:call-template>
    <xsl:apply-templates/>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:epigraph
Documentation

Description

Process element epigraph
Namespace No namespace
Match tei:epigraph
Mode #default
References
Template
Import precedence 14
Source
<xsl:template match="tei:epigraph">
  <div>
    <xsl:call-template name="makeRendition"/>
    <xsl:apply-templates/>
  </div>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:epigraph/tei:lg
Documentation

Description

Process element epigraph/lg
Namespace No namespace
Match tei:epigraph/tei:lg
Mode #default
Import precedence 14
Source
<xsl:template match="tei:epigraph/tei:lg">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:caesura
Documentation

Description

Process element caesura
Namespace No namespace
Match tei:caesura
Mode #default
References
Template
Import precedence 14
Source
<xsl:template match="tei:caesura">
  <span>
    <xsl:call-template name="makeRendition"/>
    <xsl:text>    </xsl:text>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:gap
Documentation

Description

Process element gap
Namespace No namespace
Match tei:gap
Mode #default
References
Function
Template
Supersedes
Template
Import precedence 14
Source
<xsl:template match="tei:gap">
  <xsl:element name="{if (not(tei:isInline(.))) then 'div' else 'span'}">
    <xsl:attribute name="class">gap</xsl:attribute>
    <xsl:if test="tei:desc">
      <xsl:attribute name="title">
        <xsl:value-of select="tei:desc"/>
      </xsl:attribute>
    </xsl:if>
    <xsl:choose>
      <xsl:when test="starts-with(@rend,'content:')">
        <xsl:value-of select="substring-after(@rend,'content:')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="makeRendition"/>
        <xsl:text> [...]</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:element>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:gloss
Documentation

Description

Process gloss element
Namespace No namespace
Match tei:gloss
Mode #default
References
Template
Import precedence 14
Source
<xsl:template match="tei:gloss">
  <span>
    <xsl:call-template name="makeRendition"/>
    <xsl:apply-templates/>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:head
Documentation

Description

Process element head

headings etc

Namespace No namespace
Match tei:head
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:head">
  <xsl:variable name="parentName" select="local-name(..)"/>
  <xsl:variable name="depth">
    <xsl:apply-templates mode="depth" select=".."/>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="parent::tei:group or parent::tei:body or parent::tei:front or parent::tei:back">
      <xsl:call-template name="splitHTMLBlocks">
        <xsl:with-param name="element">h1</xsl:with-param>
        <xsl:with-param name="content">
          <xsl:apply-templates/>
        </xsl:with-param>
        <xsl:with-param name="copyid">false</xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="parent::tei:argument">
      <div>
        <xsl:call-template name="makeRendition">
          <xsl:with-param name="default">false</xsl:with-param>
        </xsl:call-template>
        <xsl:apply-templates/>
      </div>
    </xsl:when>
    <xsl:when test="not(starts-with($parentName,'div'))">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="not(preceding-sibling::tei:head) and starts-with($parentName,'div') and (tei:keepDivOnPage(..) or          number($depth)  > number($splitLevel))">
      <xsl:variable name="Heading">
        <xsl:for-each select="..">
          <xsl:call-template name="splitHTMLBlocks">
            <xsl:with-param name="element" select="if (number($depth)+$divOffset >6) then 'div'             else             concat('h',number($depth)+$divOffset)"/>
            <xsl:with-param name="content">
              <xsl:call-template name="sectionHeadHook"/>
              <xsl:call-template name="header">
                <xsl:with-param name="display">full</xsl:with-param>
              </xsl:call-template>
            </xsl:with-param>
            <xsl:with-param name="copyid">false</xsl:with-param>
          </xsl:call-template>
        </xsl:for-each>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="$outputTarget=('html5', 'html') and number($depth)  < 1">
          <header>
            <xsl:copy-of select="$Heading"/>
          </header>
        </xsl:when>
        <xsl:otherwise>
          <xsl:copy-of select="$Heading"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:headmakeheading
Documentation

Description

Process element head in heading mode
Namespace No namespace
Match tei:head
Mode makeheading
References
Import precedence 14
Source
<xsl:template match="tei:head" mode="makeheading">
  <xsl:if test="preceding-sibling::tei:head">
    <xsl:call-template name="lineBreak"/>
  </xsl:if>
  <xsl:call-template name="splitHTMLBlocks">
    <xsl:with-param name="element">span</xsl:with-param>
    <xsl:with-param name="class">head</xsl:with-param>
    <xsl:with-param name="content">
      <xsl:apply-templates/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:hi
Documentation

Description

Process element hi
Namespace No namespace
Match tei:hi
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:hi">
  <xsl:variable name="rend">
    <x>
      <xsl:call-template name="makeRendition"/>
    </x>
  </xsl:variable>
  <xsl:variable name="container" select="if (tei:render-superscript(.)) then 'sup'                                             else if (tei:render-subscript(.)) then 'sub'                                             else if (tei:match(@rend,'code')) then 'code' else 'span'"/>
  <xsl:for-each-group select="*|text()" group-adjacent="if (self::tei:note or                                         self::tei:q/tei:l or                                         self::tei:q/tei:p or                                         self::tei:table or                                         self::tei:list or                                          self::tei:figure)  then 1                                           else 2">
    <xsl:choose>
      <xsl:when test="current-grouping-key()=1">
        <xsl:apply-templates select="current-group()"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:element name="{$container}">
          <xsl:copy-of select="$rend/*/@*"/>
          <xsl:apply-templates select="current-group()"/>
        </xsl:element>
        <!--      ***<xsl:value-of select="current-group()"/>*** -->
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each-group>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:itembibl
Documentation

Description

Process element item
Namespace No namespace
Match tei:item
Mode bibl
References
Template
Import precedence 14
Source
<xsl:template match="tei:item" mode="bibl">
  <p>
    <xsl:if test="@xml:id">
      <xsl:call-template name="makeAnchor"/>
    </xsl:if>
    <xsl:apply-templates/>
  </p>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:itemglosstable
Documentation

Description

Process element item
Namespace No namespace
Match tei:item
Mode glosstable
References
Template
Import precedence 14
Source
<xsl:template match="tei:item" mode="glosstable">
  <tr>
    <td style="vertical-align:top;">
      <strong>
        <xsl:apply-templates mode="print" select="preceding-sibling::tei:*[1]"/>
      </strong>
    </td>
    <td>
      <xsl:if test="@xml:id">
        <xsl:call-template name="makeAnchor"/>
      </xsl:if>
      <xsl:apply-templates/>
    </td>
  </tr>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:labelgloss
Documentation

Description

Process element item
Namespace No namespace
Match tei:label
Mode gloss
Import precedence 14
Source
<xsl:template match="tei:label" mode="gloss"/>
Stylesheet location ../html/html_core.xsl
Template tei:itemgloss
Namespace No namespace
Match tei:item
Mode gloss
References
Template
Import precedence 14
Source
<xsl:template match="tei:item" mode="gloss">
  <dt>
    <xsl:if test="@xml:id">
      <xsl:call-template name="makeAnchor"/>
    </xsl:if>
    <xsl:apply-templates mode="print" select="preceding-sibling::tei:label[1]"/>
  </dt>
  <dd>
    <xsl:apply-templates/>
  </dd>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:item/tei:label|tei:eTree/tei:label|tei:eLeaf/tei:label
Documentation

Description

Process element label inside item or leaf
Namespace No namespace
Match tei:item/tei:label|tei:eTree/tei:label|tei:eLeaf/tei:label
Mode #default
References
Template
Import precedence 14
Source
<xsl:template match="tei:item/tei:label|tei:eTree/tei:label|tei:eLeaf/tei:label">
  <span>
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="default" select="@type"/>
    </xsl:call-template>
    <xsl:apply-templates/>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:labelprint
Documentation

Description

Process element label in print mode
Namespace No namespace
Match tei:label
Mode print
References
Import precedence 14
Source
<xsl:template match="tei:label" mode="print">
  <span>
    <xsl:if test="@xml:id">
      <xsl:call-template name="makeAnchor"/>
    </xsl:if>
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="default">false</xsl:with-param>
    </xsl:call-template>
    <xsl:apply-templates/>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template lineBreak
Documentation

Description

Line break
Namespace No namespace
Used by
References
Template
Supersedes
Template
Import precedence 14
Source
<xsl:template name="lineBreak">
  <br>
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="default">false</xsl:with-param>
    </xsl:call-template>
  </br>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template lineBreakAsPara
Namespace No namespace
Used by
Template
References
Template
Supersedes
Template
Import precedence 14
Source
<xsl:template name="lineBreakAsPara">
  <br>
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="default">false</xsl:with-param>
    </xsl:call-template>
  </br>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:l
Documentation

Description

Process element l
Namespace No namespace
Match tei:l
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:l">
  <xsl:element name="{if (ancestor::tei:hi) then 'span' else 'div'}">
    <xsl:if test="@xml:id">
      <xsl:call-template name="makeAnchor"/>
    </xsl:if>
    <xsl:call-template name="makeRendition"/>
    <xsl:choose>
      <xsl:when test="ancestor::tei:div[tei:match(@rend,'linenumber')]">
        <xsl:variable name="n">
          <xsl:number/>
        </xsl:variable>
        <div class="numbering">
          <xsl:choose>
            <xsl:when test="$n mod 5 = 0">
              <xsl:value-of select="$n"/>
            </xsl:when>
            <xsl:otherwise> </xsl:otherwise>
          </xsl:choose>
        </div>
        <xsl:apply-templates/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:apply-templates/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:element>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:lg
Documentation

Description

Process element lg
Namespace No namespace
Match tei:lg
Mode #default
References
Parameter
Templates
Import precedence 14
Source
<xsl:template match="tei:lg">
  <xsl:choose>
    <xsl:when test="$filePerPage='true'">
      <xsl:for-each-group select="node()" group-starting-with="tei:pb">
        <xsl:choose>
          <xsl:when test="self::tei:pb">
            <xsl:apply-templates select="."/>
            <div>
              <xsl:for-each select="..">
                <xsl:call-template name="makeRendition"/>
                <xsl:attribute name="id">
                  <xsl:choose>
                    <xsl:when test="@xml:id">
                      <xsl:value-of select="@xml:id"/>
                      <xsl:text>continued</xsl:text>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:text>false</xsl:text>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:attribute>
              </xsl:for-each>
              <xsl:apply-templates select="current-group() except ."/>
            </div>
          </xsl:when>
          <xsl:otherwise>
            <div>
              <xsl:for-each select="..">
                <xsl:call-template name="makeRendition"/>
              </xsl:for-each>
              <xsl:apply-templates select="current-group()"/>
            </div>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each-group>
    </xsl:when>
    <xsl:otherwise>
      <div>
        <xsl:if test="@xml:id">
          <xsl:call-template name="makeAnchor"/>
        </xsl:if>
        <xsl:call-template name="makeRendition"/>
        <xsl:apply-templates/>
      </div>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:list
Documentation

Description

Process element list

Lists. Depending on the value of the 'type' attribute, various HTML lists are generated:

bibl
Items are processed in mode 'bibl'
catalogue
A gloss list is created, inside a paragraph
gloss
A gloss list is created, expecting alternate label and item elements
glosstable
Label and item pairs are laid out in a two-column table
inline
A comma-separate inline list
inline
An inline list with bullets between items
unordered
A simple unordered list
ordered
A simple ordered list
valList
(Identical to glosstable)

Namespace No namespace
Match tei:list
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:list">
  <xsl:if test="tei:head">
    <xsl:element name="{if (tei:isInline(.)) then 'span' else 'div' }">
      <xsl:attribute name="class">listhead</xsl:attribute>
      <xsl:apply-templates select="tei:head"/>
    </xsl:element>
  </xsl:if>
  <xsl:variable name="listcontents">
    <xsl:choose>
      <xsl:when test="@type='catalogue'">
        <p>
          <dl>
            <xsl:apply-templates select="@xml:id"/>
            <xsl:call-template name="makeRendition">
              <xsl:with-param name="default">false</xsl:with-param>
            </xsl:call-template>
            <xsl:for-each select="*[not(self::tei:head)]">
              <p/>
              <xsl:apply-templates mode="gloss" select="."/>
            </xsl:for-each>
          </dl>
        </p>
      </xsl:when>
      <xsl:when test="@type='gloss' and tei:match(@rend,'multicol')">
        <xsl:variable name="nitems">
          <xsl:value-of select="count(tei:item) div 2"/>
        </xsl:variable>
        <p>
          <table>
            <xsl:apply-templates select="@xml:id"/>
            <xsl:call-template name="makeRendition">
              <xsl:with-param name="default">false</xsl:with-param>
            </xsl:call-template>
            <tr>
              <td style="vertical-align:top;">
                <dl>
                  <xsl:apply-templates mode="gloss" select="tei:item[position()<=$nitems ]"/>
                </dl>
              </td>
              <td style="vertical-align:top;">
                <dl>
                  <xsl:apply-templates mode="gloss" select="tei:item[position() >$nitems]"/>
                </dl>
              </td>
            </tr>
          </table>
        </p>
      </xsl:when>
      <xsl:when test="tei:isGlossList(.)">
        <dl>
          <xsl:apply-templates select="@xml:id"/>
          <xsl:call-template name="makeRendition">
            <xsl:with-param name="default">false</xsl:with-param>
          </xsl:call-template>
          <xsl:apply-templates mode="gloss" select="*[not(self::tei:head or self::tei:trailer)]"/>
        </dl>
      </xsl:when>
      <xsl:when test="tei:isGlossTable(.)">
        <table>
          <xsl:apply-templates select="@xml:id"/>
          <xsl:call-template name="makeRendition">
            <xsl:with-param name="default">false</xsl:with-param>
          </xsl:call-template>
          <xsl:apply-templates mode="glosstable" select="*[not(self::tei:head  or self::tei:trailer)]"/>
        </table>
      </xsl:when>
      <xsl:when test="tei:isInlineList(.)">
        <xsl:apply-templates select="*[not(self::tei:head or self::tei:trailer)]" mode="inline"/>
      </xsl:when>
      <xsl:when test="@type='inline' or @type='runin'">
        <p>
          <xsl:apply-templates select="@xml:id"/>
          <xsl:apply-templates select="*[not(self::tei:head or self::tei:trailer)]" mode="inline"/>
        </p>
      </xsl:when>
      <xsl:when test="@type='bibl'">
        <xsl:apply-templates select="*[not(self::tei:head or self::tei:trailer)]" mode="bibl"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:element name="{if (tei:isOrderedList(.)) then 'ol' else 'ul'}">
          <xsl:apply-templates select="@xml:id"/>
          <xsl:call-template name="makeRendition">
            <xsl:with-param name="default">false</xsl:with-param>
          </xsl:call-template>
          <xsl:if test="starts-with(@type,'ordered:')">
            <xsl:attribute name="start">
              <xsl:value-of select="substring-after(@type,':')"/>
            </xsl:attribute>
          </xsl:if>
          <xsl:apply-templates select="*[not(self::tei:head or self::tei:trailer)]"/>
        </xsl:element>
        <xsl:apply-templates select="tei:trailer"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <!--
        <xsl:variable name="n">
      <xsl:number level="any"/>
    </xsl:variable>
    <xsl:result-document href="/tmp/list{$n}.xml">
      <xsl:copy-of select="$listcontents"/>
      </xsl:result-document>
      -->
  <xsl:apply-templates mode="inlist" select="$listcontents"/>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template @*|text()|comment()|processing-instruction()inlist
Namespace No namespace
Match @*|text()|comment()|processing-instruction()
Mode inlist
Import precedence 14
Source
<xsl:template match="@*|text()|comment()|processing-instruction()" mode="inlist">
  <xsl:copy-of select="."/>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template html:ul/html:spaninlist
Namespace No namespace
Match html:ul/html:span
Mode inlist
Import precedence 14
Source
<xsl:template match="html:ul/html:span" mode="inlist"/>
Stylesheet location ../html/html_core.xsl
Template html:ol/html:spaninlist
Namespace No namespace
Match html:ol/html:span
Mode inlist
Import precedence 14
Source
<xsl:template match="html:ol/html:span" mode="inlist"/>
Stylesheet location ../html/html_core.xsl
Template html:dl/html:spaninlist
Namespace No namespace
Match html:dl/html:span
Mode inlist
Import precedence 14
Source
<xsl:template match="html:dl/html:span" mode="inlist"/>
Stylesheet location ../html/html_core.xsl
Template html:ul/html:brinlist
Namespace No namespace
Match html:ul/html:br
Mode inlist
Import precedence 14
Source
<xsl:template match="html:ul/html:br" mode="inlist"/>
Stylesheet location ../html/html_core.xsl
Template html:ol/html:brinlist
Namespace No namespace
Match html:ol/html:br
Mode inlist
Import precedence 14
Source
<xsl:template match="html:ol/html:br" mode="inlist"/>
Stylesheet location ../html/html_core.xsl
Template html:dl/html:brinlist
Namespace No namespace
Match html:dl/html:br
Mode inlist
Import precedence 14
Source
<xsl:template match="html:dl/html:br" mode="inlist"/>
Stylesheet location ../html/html_core.xsl
Template html:li|html:dtinlist
Namespace No namespace
Match html:li|html:dt
Mode inlist
Import precedence 14
Source
<xsl:template match="html:li|html:dt" mode="inlist">
  <xsl:copy>
    <xsl:apply-templates mode="inlist" select="@*"/>
    <xsl:copy-of select="preceding-sibling::*[1][self::html:span] | preceding-sibling::*[1][self::html:br]"/>
    <xsl:apply-templates mode="inlist" select="*|text()|comment()|processing-instruction()"/>
  </xsl:copy>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template *inlist
Namespace No namespace
Match *
Mode inlist
Import precedence 14
Source
<xsl:template match="*" mode="inlist">
  <xsl:copy>
    <xsl:apply-templates mode="inlist" select="@*"/>
    <xsl:apply-templates mode="inlist" select="*|text()|comment()|processing-instruction()"/>
  </xsl:copy>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:list/tei:label
Documentation

Description

Bypass element list/label
Namespace No namespace
Match tei:list/tei:label
Mode #default
Import precedence 14
Source
<xsl:template match="tei:list/tei:label"/>
Stylesheet location ../html/html_core.xsl
Template tei:listBibl
Documentation

Description

Process element listBibl
Namespace No namespace
Match tei:listBibl
Mode #default
References
Function
Parameter
Template
Import precedence 14
Source
<xsl:template match="tei:listBibl">
  <xsl:if test="tei:head">
    <xsl:element name="{if (not(tei:isInline(.))) then 'div' else 'span' }">
      <xsl:attribute name="class">listhead</xsl:attribute>
      <xsl:apply-templates select="tei:head"/>
    </xsl:element>
  </xsl:if>
  <xsl:choose>
    <xsl:when test="tei:biblStruct and $biblioStyle='mla'">
      <div type="listBibl" xmlns="http://www.w3.org/1999/xhtml">
        <xsl:for-each select="tei:biblStruct">
          <p class="hang" xmlns="http://www.w3.org/1999/xhtml">
            <xsl:apply-templates select="tei:analytic" mode="mla"/>
            <xsl:apply-templates select="tei:monogr" mode="mla"/>
            <xsl:apply-templates select="tei:relatedItem" mode="mla"/>
            <xsl:choose>
              <xsl:when test="tei:note">
                <xsl:apply-templates select="tei:note"/>
              </xsl:when>
              <xsl:when test="*//tei:ref/@target and not(contains(*//tei:ref/@target, '#'))">
                <xsl:text>Web.
</xsl:text>
                <xsl:if test="*//tei:imprint/tei:date/@type='access'">
                  <xsl:value-of select="*//tei:imprint/tei:date[@type='access']"/>
                  <xsl:text>.</xsl:text>
                </xsl:if>
              </xsl:when>
              <xsl:when test="tei:analytic/tei:title[@level='u'] or tei:monogr/tei:title[@level='u']"/>
              <xsl:otherwise>Print.
</xsl:otherwise>
            </xsl:choose>
            <xsl:if test="tei:monogr/tei:imprint/tei:extent">
              <xsl:value-of select="tei:monogr/tei:imprint/tei:extent"/>. </xsl:if>
            <xsl:if test="tei:series/tei:title[@level='s']">
              <xsl:apply-templates select="tei:series/tei:title[@level='s']"/>
              <xsl:text>. </xsl:text>
            </xsl:if>
          </p>
        </xsl:for-each>
      </div>
    </xsl:when>
    <xsl:when test="tei:biblStruct and not(tei:bibl)">
      <ol class="listBibl {$biblioStyle}">
        <xsl:for-each select="tei:biblStruct">
          <xsl:sort select="lower-case(normalize-space((@sortKey,tei:*[1]/tei:author/tei:surname                               ,tei:*[1]/tei:author/tei:orgName                               ,tei:*[1]/tei:author/tei:name                               ,tei:*[1]/tei:author                               ,tei:*[1]/tei:editor/tei:surname                               ,tei:*[1]/tei:editor/tei:name                               ,tei:*[1]/tei:editor                               ,tei:*[1]/tei:title[1])[1]))"/>
          <xsl:sort select="lower-case(normalize-space((                               tei:*[1]/tei:author/tei:forename                               ,tei:*[1]/tei:editor/tei:forename                               ,'')[1]))"/>
          <xsl:sort select="head(tei:monogr/tei:imprint/tei:date)"/>
          <li>
            <xsl:call-template name="makeAnchor"/>
            <xsl:apply-templates select="."/>
          </li>
        </xsl:for-each>
      </ol>
    </xsl:when>
    <xsl:when test="tei:msDesc">
      <xsl:for-each select="*[not(self::tei:head)]">
        <div class="msDesc">
          <xsl:apply-templates/>
        </div>
      </xsl:for-each>
    </xsl:when>
    <xsl:otherwise>
      <ol class="listBibl">
        <xsl:for-each select="*[not(self::tei:head)]">
          <li>
            <xsl:if test="not(@xml:id)">
              <xsl:call-template name="makeAnchor">
                <xsl:with-param name="name">
                  <xsl:apply-templates mode="ident" select="."/>
                </xsl:with-param>
              </xsl:call-template>
            </xsl:if>
            <xsl:apply-templates select="."/>
          </li>
        </xsl:for-each>
      </ol>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:nameplain
Documentation

Description

Process element name in mode "plain"
Namespace No namespace
Match tei:name
Mode plain
References
Template
Import precedence 14
Source
<xsl:template match="tei:name" mode="plain">
  <xsl:variable name="ident">
    <xsl:apply-templates mode="ident" select="."/>
  </xsl:variable>
  <span>
    <xsl:call-template name="makeAnchor">
      <xsl:with-param name="name">
        <xsl:value-of select="$ident"/>
      </xsl:with-param>
    </xsl:call-template>
    <xsl:apply-templates/>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template plainNote
Documentation

Description

Process plain note without any @place attribute
Namespace No namespace
Used by
References
Supersedes
Template
Import precedence 14
Source
<xsl:template name="plainNote">
  <xsl:variable name="identifier">
    <xsl:call-template name="noteID"/>
  </xsl:variable>
  <span>
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="auto">note</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="makeAnchor">
      <xsl:with-param name="name" select="$identifier"/>
    </xsl:call-template>
    <span class="noteLabel">
      <xsl:choose>
        <xsl:when test="@n">
          <xsl:value-of select="@n"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:sequence select="tei:i18n('Note')"/>
          <xsl:text>: </xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </span>
    <xsl:apply-templates/>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template endNote
Documentation

Description

Process footnotes and endnotes
Namespace No namespace
Used by
Template
References
Template
Supersedes
Template
Import precedence 14
Source
<xsl:template name="endNote">
  <xsl:call-template name="footNote"/>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template footNote
Namespace No namespace
Used by
Templates
References
Supersedes
Template
Import precedence 14
Source
<xsl:template name="footNote">
  <xsl:variable name="identifier">
    <xsl:call-template name="noteID"/>
  </xsl:variable>
  <xsl:element name="{if (tei:isInline(.)) then 'span' else 'div' }">
    <xsl:call-template name="makeAnchor">
      <xsl:with-param name="name" select="concat($identifier,'_return')"/>
    </xsl:call-template>
    <xsl:variable name="note-title">
      <xsl:variable name="note-text">
        <xsl:apply-templates mode="plain"/>
      </xsl:variable>
      <xsl:value-of select="substring($note-text,1,150)"/>
      <xsl:if test="string-length($note-text) > 150">
        <xsl:text></xsl:text>
      </xsl:if>
    </xsl:variable>
    <xsl:choose>
      <xsl:when test="$footnoteFile='true'">
        <a class="notelink" title="{normalize-space($note-title)}" href="{$masterFile}-notes.html#{$identifier}">
          <xsl:element name="{if (tei:match(@rend,'nosup')) then 'span' else 'sup'}">
            <xsl:call-template name="noteN"/>
          </xsl:element>
        </a>
        <xsl:if test="following-sibling::node()[1][self::tei:note]">
          <xsl:element name="{if (tei:match(@rend,'nosup')) then 'span' else 'sup'}">
            <xsl:text>,</xsl:text>
          </xsl:element>
        </xsl:if>
      </xsl:when>
      <xsl:otherwise>
        <a class="notelink" title="{normalize-space($note-title)}" href="#{$identifier}">
          <xsl:element name="{if (tei:match(@rend,'nosup')) then 'span' else 'sup'}">
            <xsl:call-template name="noteN"/>
          </xsl:element>
        </a>
        <xsl:if test="following-sibling::node()[1][self::tei:note]">
          <xsl:element name="{if (tei:match(@rend,'nosup')) then 'span' else 'sup'}">
            <xsl:text>,</xsl:text>
          </xsl:element>
        </xsl:if>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:element>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template displayNote
Documentation

Description

Process display-style note
Namespace No namespace
Used by
Template
References
Supersedes
Template
Import precedence 14
Source
<xsl:template name="displayNote">
  <xsl:variable name="identifier">
    <xsl:call-template name="noteID"/>
  </xsl:variable>
  <xsl:element name="{if (tei:isInline(.)) then 'span' else 'div'}">
    <xsl:attribute name="class">note</xsl:attribute>
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="auto">note</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="makeAnchor">
      <xsl:with-param name="name" select="$identifier"/>
    </xsl:call-template>
    <span class="noteLabel">
      <xsl:choose>
        <xsl:when test="@n">
          <xsl:value-of select="@n"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:sequence select="tei:i18n('Note')"/>
          <xsl:text>: </xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </span>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template marginalNote
Documentation

Description

Process note with a @place attribute in the margin
Namespace No namespace
Used by
Template
References
Templates
Function
Supersedes
Template
Import precedence 14
Source
<xsl:template name="marginalNote">
  <xsl:variable name="identifier">
    <xsl:call-template name="noteID"/>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="@type='milestone'">
      <span class="{if (@place) then if (contains(@place,'right'))                      then 'notemarginRight' else 'notemarginLeft' else 'notemarginLeft'}">
        <xsl:call-template name="makeAnchor">
          <xsl:with-param name="name" select="$identifier"/>
        </xsl:call-template>
        <xsl:apply-templates/>
      </span>
    </xsl:when>
    <xsl:when test="parent::tei:item or                       parent::tei:cell or                       parent::tei:salute or                       parent::tei:head/parent::tei:list or                        parent::tei:q/parent::tei:div or                        parent::tei:div or                        parent::tei:l or                       parent::tei:bibl/parent::tei:q/parent::tei:epigraph or                       parent::tei:bibl/parent::tei:q/parent::tei:p                        ">
      <div class="{if (@place) then if (contains(@place,'right'))                      then 'notemarginRight' else 'notemarginLeft' else 'notemarginLeft'}">
        <xsl:call-template name="makeAnchor">
          <xsl:with-param name="name" select="$identifier"/>
        </xsl:call-template>
        <xsl:apply-templates/>
      </div>
    </xsl:when>
    <xsl:when test="not(parent::tei:p or parent::tei:head)">
      <span class="{if (@place) then if (contains(@place,'right'))                      then 'notemarginRight' else 'notemarginLeft' else 'notemarginLeft'}">
        <xsl:call-template name="makeAnchor">
          <xsl:with-param name="name" select="$identifier"/>
        </xsl:call-template>
        <xsl:apply-templates/>
      </span>
    </xsl:when>
    <xsl:when test="@place='margin' and parent::tei:hi and not(*)">
      <aside class="note{@place}">
        <xsl:call-template name="makeAnchor">
          <xsl:with-param name="name" select="$identifier"/>
        </xsl:call-template>
        <xsl:apply-templates/>
      </aside>
    </xsl:when>
    <xsl:when test="*[not(tei:isInline(.))]">
      <aside class="note{@place}">
        <xsl:call-template name="makeAnchor">
          <xsl:with-param name="name" select="$identifier"/>
        </xsl:call-template>
        <xsl:apply-templates/>
      </aside>
    </xsl:when>
    <xsl:when test="tokenize(@place,' ')=('margin','marginRight','margin-right','margin_right')">
      <aside class="notemarginRight">
        <xsl:call-template name="makeAnchor">
          <xsl:with-param name="name" select="$identifier"/>
        </xsl:call-template>
        <xsl:apply-templates/>
      </aside>
    </xsl:when>
    <xsl:when test="tokenize(@place,' ')=('margin','marginLeft','margin-left','margin_left')">
      <aside class="notemarginLeft">
        <xsl:call-template name="makeAnchor">
          <xsl:with-param name="name" select="$identifier"/>
        </xsl:call-template>
        <xsl:apply-templates/>
      </aside>
    </xsl:when>
    <xsl:otherwise>
      <aside class="notemarginLeft {@place}">
        <xsl:call-template name="makeAnchor">
          <xsl:with-param name="name" select="$identifier"/>
        </xsl:call-template>
        <xsl:apply-templates/>
      </aside>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:noteprintallnotes
Documentation

Description

Check whether a note should be processed if we are at the top
Namespace No namespace
Match tei:note
Mode printallnotes
References
Parameter
Template
Function
Import precedence 14
Source
<xsl:template match="tei:note" mode="printallnotes">
  <xsl:choose>
    <xsl:when test="number($splitLevel)=-1">
      <xsl:call-template name="makeaNote"/>
    </xsl:when>
    <xsl:when test="ancestor::tei:group"/>
    <xsl:when test="ancestor::tei:floatingText"/>
    <xsl:when test="ancestor::tei:div[tei:keepDivOnPage(.)]">
      <xsl:call-template name="makeaNote"/>
    </xsl:when>
    <xsl:when test="not(ancestor::tei:div or ancestor::tei:div1)">
      <xsl:call-template name="makeaNote"/>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:noteprintnotes
Documentation

Description

Check whether a note should be processed. If we are splitting, check that we are in the correct file
Namespace No namespace
Match tei:note
Mode printnotes
References
Parameters
QName Namespace Select
whence No namespace .
Import precedence 14
Source
<xsl:template match="tei:note" mode="printnotes">
  <xsl:param name="whence" select="."/>
  <xsl:choose>
    <xsl:when test="ancestor::tei:listBibl"/>
    <xsl:when test="ancestor::tei:floatingText"/>
    <xsl:when test="number($splitLevel)=-1"/>
    <xsl:when test="tei:isEndNote(.) or tei:isFootNote(.) or                       $autoEndNotes='true'">
      <xsl:variable name="parent">
        <xsl:for-each select="ancestor::tei:*[local-name()='div'             or local-name()='div1'             or local-name()='div2'             or local-name()='div3'             or local-name()='div4'             or local-name()='div5'             or local-name()='div6'][1]">
          <xsl:call-template name="locateParentDiv"/>
        </xsl:for-each>
      </xsl:variable>
      <xsl:if test="$whence = $parent">
        <xsl:call-template name="makeaNote"/>
      </xsl:if>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template makeaNote
Documentation

Description

Process element note
Namespace No namespace
Used by
References
Templates
Parameters
Import precedence 14
Source
<xsl:template name="makeaNote">
  <xsl:variable name="identifier">
    <xsl:call-template name="noteID"/>
  </xsl:variable>
  <xsl:if test="$verbose='true'">
    <xsl:message>Make note
      <xsl:value-of select="$identifier"/>
    </xsl:message>
  </xsl:if>
  <div class="note">
    <xsl:call-template name="makeAnchor">
      <xsl:with-param name="name" select="$identifier"/>
    </xsl:call-template>
    <span class="noteLabel">
      <xsl:call-template name="noteN"/>
      <xsl:if test="matches(@n,'[0-9]')">
        <xsl:text>.</xsl:text>
      </xsl:if>
      <xsl:text> </xsl:text>
    </span>
    <div class="noteBody">
      <xsl:apply-templates/>
    </div>
    <xsl:if test="$footnoteBackLink= 'true'">
      <xsl:text> </xsl:text>
      <a class="link_return" title="Go back to text" href="#{concat($identifier,'_return')}"></a>
    </xsl:if>
  </div>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:note[@type='action']
Documentation

Description

Process element note[@type='action']
Namespace No namespace
Match tei:note[@type='action']
Mode #default
Import precedence 14
Source
<xsl:template match="tei:note[@type='action']">
  <div class="right">
    <b>Action <xsl:number count="tei:note[@type='action']" level="any"/>
    </b>: <i><xsl:apply-templates/></i>
  </div>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:pb|tei:gbident
Documentation

Description

Process element pb and gb

Indication of a page or gathering break. For the purposes of HTML, we simply make it an anchor if it has an ID.

Namespace No namespace
Match tei:pb|tei:gb
Mode ident
Import precedence 14
Source
<xsl:template match="tei:pb|tei:gb" mode="ident">
  <xsl:choose>
    <xsl:when test="@xml:id">
      <xsl:value-of select="@xml:id"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:sequence select="if (self::tei:gb) then 'gathering' else 'page'"/>
      <xsl:number level="any"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:pb|tei:gb
Namespace No namespace
Match tei:pb|tei:gb
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:pb|tei:gb">
  <xsl:choose>
    <xsl:when test="$filePerPage='true'">
      <PAGEBREAK>
        <xsl:attribute name="name">
          <xsl:apply-templates select="." mode="ident"/>
        </xsl:attribute>
        <xsl:copy-of select="@facs"/>
      </PAGEBREAK>
    </xsl:when>
    <xsl:when test="$pagebreakStyle='active'">
      <div>
        <xsl:call-template name="makeRendition">
          <xsl:with-param name="default" select="'pagebreak'"/>
        </xsl:call-template>
      </div>
    </xsl:when>
    <xsl:when test="$pagebreakStyle='none'"/>
    <xsl:otherwise>
      <xsl:element name="{if (parent::tei:body or parent::tei:front                            or parent::tei:div  or parent::tei:back or                            parent::tei:lg or parent::tei:group) then 'div' else 'span'}">
        <xsl:call-template name="makeRendition">
          <xsl:with-param name="default" select="'pagebreak'"/>
        </xsl:call-template>
        <xsl:call-template name="makeAnchor"/>
        <xsl:variable name="Words">
          <xsl:text>[</xsl:text>
          <xsl:sequence select="if (self::tei:gb) then tei:i18n('gathering') else tei:i18n('page')"/>
          <xsl:if test="@n">
            <xsl:text> </xsl:text>
            <xsl:value-of select="@n"/>
          </xsl:if>
          <xsl:text>]</xsl:text>
        </xsl:variable>
        <xsl:choose>
          <xsl:when test="$pagebreakStyle='simple'">
            <xsl:copy-of select="$Words"/>
          </xsl:when>
          <xsl:when test="rend='none'"/>
          <xsl:when test="$pagebreakStyle='display' and @facs">
            <div class="facsimage">
              <img src="{@facs}"/>
            </div>
          </xsl:when>
          <xsl:when test="starts-with(@facs,'unknown:')">
            <xsl:copy-of select="$Words"/>
          </xsl:when>
          <xsl:when test="@facs">
            <xsl:variable name="IMG">
              <xsl:choose>
                <xsl:when test="starts-with(@facs,'#')">
                  <xsl:for-each select="id(substring(@facs,2))">
                    <xsl:value-of select="tei:graphic[1]/tei:resolveURI(.,@url)"/>
                  </xsl:for-each>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="tei:resolveURI(.,@facs)"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <a href="{$IMG}">
              <xsl:copy-of select="$Words"/>
            </a>
          </xsl:when>
          <xsl:otherwise>
            <xsl:copy-of select="$Words"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:element>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:p
Documentation

Description

Process element p
Namespace No namespace
Match tei:p
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:p">
  <xsl:variable name="wrapperElement" select="tei:isDivOrP(.)"/>
  <xsl:choose>
    <xsl:when test="$filePerPage='true'">
      <xsl:for-each-group select="node()" group-starting-with="tei:pb">
        <xsl:choose>
          <xsl:when test="self::tei:pb">
            <xsl:apply-templates select="."/>
            <xsl:element name="{$wrapperElement}">
              <xsl:for-each select="..">
                <xsl:call-template name="makeRendition">
                  <xsl:with-param name="default">false</xsl:with-param>
                </xsl:call-template>
                <xsl:attribute name="id">
                  <xsl:choose>
                    <xsl:when test="@xml:id">
                      <xsl:value-of select="@xml:id"/>
                      <xsl:text>continued</xsl:text>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:text>false</xsl:text>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:attribute>
              </xsl:for-each>
              <xsl:apply-templates select="current-group() except ."/>
            </xsl:element>
          </xsl:when>
          <xsl:otherwise>
            <xsl:element name="{$wrapperElement}">
              <xsl:for-each select="..">
                <xsl:call-template name="makeRendition">
                  <xsl:with-param name="default">false</xsl:with-param>
                </xsl:call-template>
              </xsl:for-each>
              <xsl:apply-templates select="current-group()"/>
            </xsl:element>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each-group>
    </xsl:when>
    <xsl:when test="teix:egXML or ancestor::tei:head or $wrapperElement='span'">
      <xsl:element name="{$wrapperElement}">
        <xsl:call-template name="makeRendition">
          <xsl:with-param name="default">p</xsl:with-param>
        </xsl:call-template>
        <xsl:if test="@xml:id or $generateParagraphIDs='true'">
          <xsl:call-template name="makeAnchor"/>
        </xsl:if>
        <xsl:if test="$numberParagraphs='true'">
          <xsl:call-template name="numberParagraph"/>
        </xsl:if>
        <xsl:apply-templates/>
      </xsl:element>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="splitHTMLBlocks">
        <xsl:with-param name="element">p</xsl:with-param>
        <xsl:with-param name="content">
          <xsl:if test="$numberParagraphs='true'">
            <xsl:call-template name="numberParagraph"/>
          </xsl:if>
          <xsl:apply-templates/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template numberParagraph
Documentation

Description

How to number paragraphs
Namespace No namespace
Used by
Templates
Import precedence 14
Source
<xsl:template name="numberParagraph">
  <span class="numberParagraph">
    <xsl:number/>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:q|tei:said
Namespace No namespace
Match tei:q|tei:said
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:q|tei:said">
  <xsl:choose>
    <xsl:when test="count(*)=1 and tei:floatingText">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="(not(parent::tei:p/text()) and count(parent::tei:p/*)=1) or tei:floatingText or not(tei:isInline(.))">
      <div>
        <xsl:call-template name="makeRendition">
          <xsl:with-param name="auto">blockquote</xsl:with-param>
        </xsl:call-template>
        <xsl:apply-templates/>
      </div>
    </xsl:when>
    <xsl:otherwise>
      <span>
        <xsl:call-template name="makeRendition"/>
        <xsl:call-template name="makeQuote"/>
      </span>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:quote
Documentation

Description

Process element quote
Namespace No namespace
Match tei:quote
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:quote">
  <xsl:choose>
    <xsl:when test="parent::tei:cit[tei:match(@rend,'display')] or                       parent::tei:cit and (tei:p or tei:l)">
      <xsl:call-template name="makeBlock">
        <xsl:with-param name="style">citquote</xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="tei:list">
      <xsl:call-template name="makeBlock">
        <xsl:with-param name="style">citquote</xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="not(tei:isInline(.))">
      <blockquote>
        <xsl:call-template name="makeRendition"/>
        <xsl:if test="@xml:id">
          <xsl:attribute name="id">
            <xsl:value-of select="@xml:id"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:choose>
          <xsl:when test="$outputTarget=('html5', 'html')">
            <xsl:apply-templates/>
          </xsl:when>
          <xsl:when test="tei:p|tei:l|tei:lg">
            <xsl:apply-templates/>
          </xsl:when>
          <xsl:otherwise>
            <p>
              <xsl:apply-templates/>
            </p>
          </xsl:otherwise>
        </xsl:choose>
      </blockquote>
    </xsl:when>
    <xsl:otherwise>
      <span>
        <xsl:call-template name="makeRendition"/>
        <xsl:call-template name="makeQuote"/>
      </span>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:resp
Documentation

Description

Process element resp
Namespace No namespace
Match tei:resp
Mode #default
Import precedence 14
Source
<xsl:template match="tei:resp">
  <xsl:apply-templates/>
  <xsl:text> </xsl:text>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:respStmt
Documentation

Description

Process element respStmt
Namespace No namespace
Match tei:respStmt
Mode #default
Import precedence 14
Source
<xsl:template match="tei:respStmt">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:seg
Documentation

Description

Process element seg, pass through @type and @rend as @class
Namespace No namespace
Match tei:seg
Mode #default
References
Import precedence 14
Source
<xsl:template match="tei:seg">
  <xsl:variable name="container" select="if (tei:render-superscript(.)) then 'sup'                                             else if (tei:render-subscript(.)) then 'sub'                                             else if (tei:match(@rend,'code')) then 'code' else 'span'"/>
  <xsl:element name="{$container}">
    <xsl:choose>
      <xsl:when test="@type">
        <xsl:call-template name="makeLang"/>
        <xsl:attribute name="class">
          <xsl:value-of select="@type"/>
        </xsl:attribute>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="makeRendition">
          <xsl:with-param name="default">false</xsl:with-param>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:if test="@xml:id">
      <xsl:call-template name="makeAnchor"/>
    </xsl:if>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:space
Documentation

Description

Process element space
Namespace No namespace
Match tei:space
Mode #default
Import precedence 14
Source
<xsl:template match="tei:space">
  <span style="display:inline-block">
    <xsl:if test="@quantity">
      <xsl:variable name="unit">
        <xsl:choose>
          <xsl:when test="@unit='chars'">
            <xsl:text>em</xsl:text>
          </xsl:when>
          <xsl:when test="@unit">
            <xsl:value-of select="@unit"/>
          </xsl:when>
          <xsl:otherwise>em</xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:attribute name="width">
        <xsl:value-of select="@quantity"/>
        <xsl:value-of select="$unit"/>
      </xsl:attribute>
    </xsl:if>
    <xsl:text> </xsl:text>
  </span>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:titlewithbr
Documentation

Description

Process element title in "withbr" mode
Namespace No namespace
Match tei:title
Mode withbr
Import precedence 14
Source
<xsl:template match="tei:title" mode="withbr">
  <xsl:value-of select="."/>
  <br/>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:body/tei:title
Documentation

Description

Process element title when it is a child of body
Namespace No namespace
Match tei:body/tei:title
Mode #default
Import precedence 14
Source
<xsl:template match="tei:body/tei:title">
  <div class="title">
    <xsl:apply-templates/>
  </div>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:witList
Documentation

Description

Process element witList
Namespace No namespace
Match tei:witList
Mode #default
Import precedence 14
Source
<xsl:template match="tei:witList">
  <xsl:apply-templates select="./witness"/>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:witness
Documentation

Description

Process element witness
Namespace No namespace
Match tei:witness
Mode #default
Import precedence 14
Source
<xsl:template match="tei:witness">
  <p id="{@sigil}">
    <b>Sigle: <xsl:value-of select="@sigil"/>
    </b>
    <br/>
    <xsl:value-of select="text()"/>
    <br/>
    <xsl:apply-templates select="tei:biblStruct"/>
    <xsl:if test="child::tei:note">
      <br/>See: <xsl:apply-templates select="child::tei:note"/></xsl:if>
  </p>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template partialFootNotes
Documentation

Description

[html] Show relevant footnotes

Parameters

currentID currentID
Namespace No namespace
Used by
Template
References
Parameter
Template
Parameters
QName Namespace
currentID No namespace
Import precedence 14
Source
<xsl:template name="partialFootNotes">
  <xsl:param name="currentID"/>
  <xsl:choose>
    <xsl:when test="$currentID='current'"/>
    <xsl:when test="$currentID='' and number($splitLevel)=-1">
      <xsl:call-template name="printNotes"/>
    </xsl:when>
    <xsl:when test="$currentID=''">
      <xsl:for-each select="descendant::tei:text">
        <xsl:call-template name="printNotes"/>
      </xsl:for-each>
    </xsl:when>
    <xsl:otherwise>
      <xsl:choose>
        <xsl:when test="count(id($currentID))>0">
          <xsl:for-each select="id($currentID)">
            <xsl:call-template name="printNotes"/>
          </xsl:for-each>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates mode="xpath" select="ancestor-or-self::tei:TEI/descendant::tei:text">
            <xsl:with-param name="xpath" select="$currentID"/>
            <xsl:with-param name="action">notes</xsl:with-param>
          </xsl:apply-templates>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template printNotes
Documentation

Description

[html] produce all the notes
Namespace No namespace
Used by
References
Import precedence 14
Source
<xsl:template name="printNotes">
  <xsl:if test="key('FOOTNOTES',1) or                   key('ENDNOTES',1) or                     ($autoEndNotes='true' and key('ALLNOTES',1))                   or (self::tei:floatingText and .//tei:note)">
    <xsl:choose>
      <xsl:when test="$footnoteFile='true'">
        <xsl:variable name="BaseFile">
          <xsl:value-of select="$masterFile"/>
          <xsl:call-template name="addCorpusID"/>
        </xsl:variable>
        <xsl:variable name="outName">
          <xsl:call-template name="outputChunkName">
            <xsl:with-param name="ident">
              <xsl:value-of select="concat($BaseFile,'-notes')"/>
            </xsl:with-param>
          </xsl:call-template>
        </xsl:variable>
        <xsl:if test="$verbose='true'">
          <xsl:message>Opening file
            <xsl:value-of select="$outName"/>
          </xsl:message>
        </xsl:if>
        <xsl:result-document encoding="{$outputEncoding}" html-version="{$htmlVersion}" normalization-form="{$normalizationForm}" href="{$outName}" method="{$outputMethod}" omit-xml-declaration="{$omitXMLDeclaration}">
          <html>
            <xsl:call-template name="addLangAtt"/>
            <xsl:variable name="pagetitle">
              <xsl:sequence select="tei:generateTitle(.)"/>
              <xsl:text>: </xsl:text>
              <xsl:sequence select="tei:i18n('noteHeading')"/>
            </xsl:variable>
            <xsl:sequence select="tei:htmlHead($pagetitle,1)"/>
            <body>
              <xsl:call-template name="bodyMicroData"/>
              <xsl:call-template name="bodyJavascriptHook"/>
              <xsl:call-template name="bodyHook"/>
              <div class="stdheader autogenerated">
                <xsl:call-template name="stdheader">
                  <xsl:with-param name="title">
                    <xsl:sequence select="tei:generateTitle(.)"/>
                    <xsl:text>: </xsl:text>
                    <xsl:sequence select="tei:i18n('noteHeading')"/>
                  </xsl:with-param>
                </xsl:call-template>
              </div>
              <div class="notes">
                <xsl:choose>
                  <xsl:when test="$autoEndNotes='true'">
                    <div class="noteHeading">
                      <xsl:sequence select="tei:i18n('noteHeading')"/>
                    </div>
                    <xsl:apply-templates mode="printnotes" select="key('ALLNOTES',1)"/>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:if test="key('FOOTNOTES',1)">
                      <div class="noteHeading footnotes">
                        <xsl:sequence select="tei:i18n('noteHeading')"/>
                      </div>
                      <xsl:apply-templates mode="printnotes" select="key('FOOTNOTES',1)"/>
                    </xsl:if>
                    <xsl:if test="key('ENDNOTES',1)">
                      <div class="noteHeading endnotes">
                        <xsl:sequence select="tei:i18n('noteHeading')"/>
                      </div>
                      <xsl:apply-templates mode="printnotes" select="key('ENDNOTES',1)"/>
                    </xsl:if>
                  </xsl:otherwise>
                </xsl:choose>
              </div>
              <xsl:call-template name="stdfooter"/>
              <xsl:call-template name="bodyEndHook"/>
            </body>
          </html>
        </xsl:result-document>
        <xsl:if test="$verbose='true'">
          <xsl:message>Closing file
            <xsl:value-of select="$outName"/>
          </xsl:message>
        </xsl:if>
      </xsl:when>
      <xsl:otherwise>
        <xsl:variable name="me">
          <xsl:apply-templates select="." mode="ident"/>
        </xsl:variable>
        <xsl:variable name="NOTES">
          <xsl:choose>
            <xsl:when test="self::tei:floatingText">
              <xsl:variable name="outer" select="generate-id(.)"/>
              <xsl:for-each select=".//tei:note[tei:isEndNote(.) or                                       tei:isFootNote(.)]">
                <xsl:choose>
                  <xsl:when test="count(ancestor-or-self::tei:floatingText)=1">
                    <xsl:call-template name="makeaNote"/>
                  </xsl:when>
                  <xsl:when test="generate-id(ancestor-or-self::tei:floatingText[1])=$outer">
                    <xsl:call-template name="makeaNote"/>
                  </xsl:when>
                </xsl:choose>
              </xsl:for-each>
            </xsl:when>
            <xsl:when test="self::tei:TEI">
              <xsl:choose>
                <xsl:when test="$autoEndNotes='true'">
                  <div class="noteHeading">
                    <xsl:sequence select="tei:i18n('noteHeading')"/>
                  </div>
                  <xsl:apply-templates mode="printallnotes" select="key('ALLNOTES',1)"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:if test="key('FOOTNOTES',1)">
                    <div class="noteHeading">
                      <xsl:sequence select="tei:i18n('noteHeading')"/>
                    </div>
                    <xsl:apply-templates mode="printallnotes" select="key('FOOTNOTES',1)"/>
                  </xsl:if>
                  <xsl:if test="key('ENDNOTES',1)">
                    <div class="noteHeading">
                      <xsl:sequence select="tei:i18n('noteHeading')"/>
                    </div>
                    <xsl:apply-templates mode="printallnotes" select="key('ENDNOTES',1)"/>
                  </xsl:if>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:when>
            <xsl:when test="self::tei:text and $splitLevel=0">
              <div class="noteHeading">
                <xsl:sequence select="tei:i18n('noteHeading')"/>
              </div>
              <xsl:for-each select="tei:front|tei:body|tei:back">
                <xsl:for-each select=".//tei:note[tei:isEndNote(.) or                               tei:isFootNote(.)]">
                  <xsl:choose>
                    <xsl:when test="ancestor::tei:floatingText"/>
                    <xsl:otherwise>
                      <xsl:call-template name="makeaNote"/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:for-each>
              </xsl:for-each>
            </xsl:when>
            <xsl:when test="parent::tei:group and tei:group">
            </xsl:when>
            <xsl:otherwise>
              <div class="noteHeading">
                <xsl:sequence select="tei:i18n('noteHeading')"/>
              </div>
              <xsl:apply-templates mode="printnotes" select=".//tei:note">
                <xsl:with-param name="whence" select="$me"/>
              </xsl:apply-templates>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:variable name="where" select="name()"/>
        <xsl:for-each select="$NOTES">
          <xsl:if test="html:div[@class='note']">
            <xsl:comment>Notes in [
              <xsl:value-of select="$where"/>]</xsl:comment>
            <div class="notes">
              <xsl:copy-of select="*|comment()"/>
            </div>
          </xsl:if>
        </xsl:for-each>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
  <xsl:if test="ancestor-or-self::tei:TEI/tei:text/descendant::tei:app">
    <div class="appcrit">
      <xsl:apply-templates mode="printnotes" select="descendant::tei:app"/>
    </div>
  </xsl:if>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template makeAnchor
Documentation

Description

[html] Create a point to which we can link in the HTML

Parameters

name value for identifier
Namespace No namespace
Used by
Parameters
QName Namespace
name No namespace
Import precedence 14
Source
<xsl:template name="makeAnchor">
  <xsl:param name="name"/>
  <xsl:choose>
    <xsl:when test="self::tei:anchor and $name">
      <a id="{$name}">
        <xsl:comment>anchor</xsl:comment>
      </a>
    </xsl:when>
    <xsl:when test="self::tei:anchor and @xml:id">
      <a id="{@xml:id}">
        <xsl:comment>anchor</xsl:comment>
      </a>
    </xsl:when>
    <xsl:when test="(self::tei:fb or self::tei:index or self::tei:anchor) and @xml:id">
      <a id="{@xml:id}">
        <xsl:comment>
          <xsl:value-of select="local-name()"/>
        </xsl:comment>
      </a>
    </xsl:when>
    <xsl:when test="self::tei:index and $name">
      <a id="{$name}">
        <xsl:comment>index</xsl:comment>
      </a>
    </xsl:when>
    <xsl:when test="$name">
      <xsl:attribute name="id" select="$name"/>
    </xsl:when>
    <xsl:when test="@xml:id">
      <xsl:attribute name="id" select="@xml:id"/>
    </xsl:when>
    <xsl:when test="self::tei:anchor">
      <a>
        <xsl:attribute name="id" select="concat($masterFile,'-',local-name(.),'-',generate-id())"/>
      </a>
    </xsl:when>
    <xsl:otherwise>
      <xsl:attribute name="id" select="concat($masterFile,'-',local-name(.),'-',generate-id())"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:soCalled
Documentation

Description

Process element soCalled
Namespace No namespace
Match tei:soCalled
Mode #default
References
Template
Parameters
Import precedence 14
Source
<xsl:template match="tei:soCalled">
  <xsl:choose>
    <xsl:when test="@rend or @rendition or @style">
      <span>
        <xsl:call-template name="makeRendition"/>
        <xsl:apply-templates/>
      </span>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$preQuote"/>
      <xsl:apply-templates/>
      <xsl:value-of select="$postQuote"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template htmlAttributes
Documentation

Description

Copy all attributes in HTML namespace
Namespace No namespace
Used by
Template
Supersedes
Template
Import precedence 14
Source
<xsl:template name="htmlAttributes">
  <xsl:for-each select="@*">
    <xsl:if test="namespace-uri(.)='http://www.w3.org/1999/xhtml'">
      <xsl:attribute name="{local-name(.)}">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:if>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template makeSpan
Namespace No namespace
Used by
References
Function
Template
Import precedence 14
Source
<xsl:template name="makeSpan">
  <xsl:element name="{if (not(tei:isInline(.))) then 'div' else 'span'}">
    <xsl:call-template name="makeRendition"/>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template microdata
Namespace No namespace
Used by
Import precedence 14
Source
<xsl:template name="microdata"/>
Stylesheet location ../html/html_core.xsl
Template tei:analyticmla
Documentation

Description

[html] processing analytic element as needed for MLA style (from Laura Mandell)
Namespace No namespace
Match tei:analytic
Mode mla
Import precedence 14
Source
<xsl:template match="tei:analytic" mode="mla">
  <xsl:variable name="refIdwHash">
    <xsl:value-of select="following-sibling::tei:monogr/tei:ref/@target"/>
  </xsl:variable>
  <xsl:variable name="refId">
    <xsl:value-of select="substring-after($refIdwHash, '#')"/>
  </xsl:variable>
  <xsl:apply-templates/>
  <xsl:if test="not(following-sibling::tei:monogr/tei:title[@level='m']) and $refId!=''">
    <xsl:text> </xsl:text>
    <xsl:if test="following-sibling::tei:monogr/tei:imprint/tei:date">
      <xsl:value-of select="following-sibling::tei:monogr/tei:imprint/tei:date"/>
      <xsl:text>. </xsl:text>
    </xsl:if>
    <xsl:choose>
      <xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[1]">
        <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[1], ',')"/>
      </xsl:when>
      <xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][1]">
        <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][1], ',')"/>
      </xsl:when>
    </xsl:choose>
    <xsl:choose>
      <xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[3]">
        <xsl:text>, </xsl:text>
        <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[2], ',')"/>
        <xsl:text>, and </xsl:text>
      </xsl:when>
      <xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][3]">
        <xsl:text>, </xsl:text>
        <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][2], ',')"/>
        <xsl:text>, and </xsl:text>
      </xsl:when>
      <xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[2]">
        <xsl:text> and </xsl:text>
        <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[2], ',')"/>
      </xsl:when>
      <xsl:when test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][2]">
        <xsl:text> and </xsl:text>
        <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][2], ',')"/>
      </xsl:when>
    </xsl:choose>
    <xsl:if test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[3]">
      <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:author[3], ',')"/>
    </xsl:if>
    <xsl:if test="ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][3]">
      <xsl:value-of select="substring-before(ancestor::tei:listBibl/tei:biblStruct[@xml:id=$refId]/tei:monogr/tei:editor[@role='editor'][3], ',')"/>
    </xsl:if>
    <xsl:text> </xsl:text>
    <xsl:value-of select="following-sibling::tei:monogr/tei:imprint/tei:biblScope[@type='pp']"/>
    <xsl:text>. </xsl:text>
  </xsl:if>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:monogrmla
Documentation

Description

[html] processing monogr element as needed for MLA style (from Laura Mandell)
Namespace No namespace
Match tei:monogr
Mode mla
Import precedence 14
Source
<xsl:template match="tei:monogr" mode="mla">
  <xsl:choose>
    <xsl:when test="preceding-sibling::tei:analytic">
      <xsl:choose>
        <xsl:when test="tei:author = parent::tei:biblStruct/tei:analytic/tei:author">
          <xsl:if test="tei:author[2]">
            <xsl:apply-templates select="tei:author"/>
          </xsl:if>
          <xsl:apply-templates select="tei:title"/>
          <xsl:if test="tei:edition">
            <xsl:apply-templates select="tei:edition"/>
          </xsl:if>
          <xsl:apply-templates select="tei:editor[@role='editor']"/>
          <xsl:if test="tei:editor[@role='translator']">
            <xsl:apply-templates select="tei:editor[@role='translator']"/>
          </xsl:if>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates select="tei:author"/>
          <xsl:apply-templates select="tei:title"/>
          <xsl:if test="tei:edition">
            <xsl:apply-templates select="tei:edition"/>
          </xsl:if>
          <xsl:apply-templates select="tei:editor[@role='editor']"/>
          <xsl:if test="tei:editor[@role='translator']">
            <xsl:apply-templates select="tei:editor[@role='translator']"/>
          </xsl:if>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:when>
    <xsl:when test="tei:editor[@role='editor'] and not(preceding-sibling::tei:analytic) and not(tei:author)">
      <xsl:apply-templates select="tei:editor[@role='editor']"/>
      <xsl:apply-templates select="tei:title"/>
      <xsl:if test="tei:edition">
        <xsl:apply-templates select="tei:edition"/>
      </xsl:if>
      <xsl:if test="tei:editor[@role='translator']">
        <xsl:apply-templates select="tei:editor[@role='translator']"/>
      </xsl:if>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-templates select="tei:author"/>
      <xsl:apply-templates select="tei:title"/>
      <xsl:if test="tei:edition">
        <xsl:apply-templates select="tei:edition"/>
      </xsl:if>
      <xsl:apply-templates select="tei:editor[@role='editor']"/>
      <xsl:if test="tei:editor[@role='translator']">
        <xsl:apply-templates select="tei:editor[@role='translator']"/>
      </xsl:if>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:choose>
    <xsl:when test="*//tei:ref/@target and not(contains(*//tei:ref/@target, '#'))">
      <xsl:if test="tei:imprint/tei:date[@type='update']">
        <xsl:value-of select="tei:imprint/tei:date[@type='update']"/>
      </xsl:if>
    </xsl:when>
    <xsl:when test="ancestor-or-self::tei:biblStruct/*/tei:title/@level='u'">
      <xsl:value-of select="tei:imprint"/>
    </xsl:when>
    <xsl:when test="tei:title/@level='m'">
      <xsl:if test="tei:imprint/tei:biblScope/@type='vol'">
        <xsl:value-of select="tei:imprint/tei:biblScope[@type='vol']"/>.</xsl:if>
      <xsl:choose>
        <xsl:when test="tei:imprint/tei:pubPlace">
          <xsl:value-of select="tei:imprint/tei:pubPlace"/>:</xsl:when>
        <xsl:otherwise>[n.p.]:</xsl:otherwise>
      </xsl:choose>
      <xsl:choose>
        <xsl:when test="tei:imprint/tei:publisher">
          <xsl:value-of select="tei:imprint/tei:publisher"/>,</xsl:when>
        <xsl:otherwise>[n.p.],</xsl:otherwise>
      </xsl:choose>
      <xsl:choose>
        <xsl:when test="tei:imprint/tei:date">
          <xsl:value-of select="tei:imprint/tei:date"/>.</xsl:when>
        <xsl:otherwise>[n.d.]</xsl:otherwise>
      </xsl:choose>
    </xsl:when>
    <xsl:when test="tei:title/@level='j'">
      <xsl:if test="tei:imprint/tei:biblScope/@type='vol'">
        <xsl:value-of select="tei:imprint/tei:biblScope[@type='vol']"/>
      </xsl:if>
      <xsl:if test="tei:imprint/tei:biblScope/@type='no'">
        <xsl:text>.</xsl:text>
        <xsl:value-of select="tei:imprint/tei:biblScope[@type='no']"/>
      </xsl:if>
      <xsl:if test="tei:imprint/tei:date">
        <xsl:text>
</xsl:text>(
        <xsl:value-of select="tei:imprint/tei:date"/>)</xsl:if>
      <xsl:if test="tei:imprint/tei:biblScope/@type='pp'">:
        <xsl:value-of select="tei:imprint/tei:biblScope[@type='pp']"/>
      </xsl:if>
      <xsl:text>. </xsl:text>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../html/html_core.xsl
Template tei:relatedItemmla
Documentation

Description

[html] processing relatedItem element as needed for MLA style (from Laura Mandell)
Namespace No namespace
Match tei:relatedItem
Mode mla
Import precedence 14
Source
<xsl:template match="tei:relatedItem" mode="mla">
  <xsl:if test="@type='otherEdition'">
    <xsl:text>Rpt. </xsl:text>
  </xsl:if>
  <xsl:if test="tei:biblStruct/tei:analytic">
    <xsl:apply-templates select="tei:biblStruct/tei:analytic" mode="mla"/>
  </xsl:if>
  <xsl:if test="tei:biblStruct/tei:monogr">
    <xsl:apply-templates select="tei:biblStruct/tei:monogr" mode="mla"/>
  </xsl:if>
</xsl:template>
Stylesheet location ../html/html_core.xsl