Mode:

Compact lists

Showing:

Documentation
Parameters
Used by
References
Supersedes
Imported modules
Included modules
Source
Main stylesheet html.xsl
Documentation

Description

TEI stylesheet for 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

Imported modules
Included modules
Stylesheet version 3.0
Template get-basename
Documentation

Description

[html] How to work out the filename component of a path

Parameters

file filename
Namespace No namespace
Used by
Template
Variable
References
Template
Parameter
Parameters
QName Namespace
file No namespace
Import precedence 14
Source
<xsl:template name="get-basename">
  <xsl:param name="file"/>
  <xsl:choose>
    <xsl:when test="contains($file,'/')">
      <xsl:call-template name="get-basename">
        <xsl:with-param name="file">
          <xsl:value-of select="substring-after($file,'/')"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:choose>
        <xsl:when test="$STDOUT='true'">
          <xsl:value-of select="$file"/>
        </xsl:when>
        <xsl:when test="contains($file,'.xml')">
          <xsl:value-of select="substring-before($file,'.xml')"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$file"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location html.xsl
Template bodyMicroData
Namespace No namespace
Used by
Import precedence 14
Source
<xsl:template name="bodyMicroData"/>
Stylesheet location html.xsl
Template makeLang
Documentation

Description

[html] Work out language code

Description

  For XHTML5 output, both @xml:lang and @lang attributes are created.
  For other output formats, such as epub, only @lang is created
Namespace No namespace
Used by
Templates
References
Parameter
Import precedence 14
Source
<xsl:template name="makeLang">
  <xsl:if test="@xml:lang">
    <xsl:choose>
      <xsl:when test="$outputTarget = ('html', 'html5')">
        <xsl:attribute name="xml:lang" select="@xml:lang"/>
        <xsl:attribute name="lang" select="@xml:lang"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:attribute name="lang" select="@xml:lang"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location html.xsl
Template makeRendition
Documentation

Description

[html] Work out rendition. In order of precedence, we first look at @rend; if that does not exist, @rendition and @style values are merged together; if neither of those exist, we look at default renditions in tagUsage; if default is set to false, we do nothing; if default has a value, use that for @class; otherwise, use the element name as a value for @class.
Namespace No namespace
Used by
References
Supersedes
Template
Parameters
QName Namespace
auto No namespace
default No namespace
Import precedence 14
Source
<xsl:template name="makeRendition">
  <xsl:param name="default"/>
  <xsl:param name="auto"/>
  <xsl:call-template name="makeLang"/>
  <xsl:choose>
    <xsl:when test="( self::tei:q or self::tei:said or self::tei:quote )                       and                       ( tei:match( @rend, 'inline') or tei:match( @rend, 'display') )                       and                       not( @rendition )                       and                       not( key('TAGREND', local-name(.) ) )  ">
      <xsl:sequence select="tei:processClass(local-name(), '')"/>
    </xsl:when>
    <xsl:when test="@rend">
      <xsl:sequence select="tei:processRend(@rend, $auto, .)"/>
    </xsl:when>
    <xsl:when test="@rendition or @style">
      <xsl:for-each select="@rendition">
        <xsl:sequence select="tei:processRendition(., $auto)"/>
      </xsl:for-each>
      <xsl:for-each select="@style">
        <xsl:sequence select="tei:processStyle(.)"/>
      </xsl:for-each>
    </xsl:when>
    <xsl:when test="key('TAGREND', local-name(.))">
      <xsl:for-each select="key('TAGREND', local-name(.))">
        <xsl:sequence select="tei:processRendition(@render, $auto)"/>
      </xsl:for-each>
    </xsl:when>
    <xsl:when test="$default = 'false'"/>
    <xsl:when test="not($default = '')">
      <xsl:sequence select="tei:processClass($default, $auto)"/>
    </xsl:when>
    <xsl:when test="parent::tei:item/parent::tei:list[@rend]">
      <xsl:sequence select="tei:processClass(parent::tei:item/parent::tei:list/@rend, $auto)"/>
    </xsl:when>
    <xsl:when test="parent::tei:item[@rend]">
      <xsl:sequence select="tei:processClass(parent::tei:item/@rend, $auto)"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:sequence select="tei:processClass(local-name(), '')"/>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:if test="$outputTarget = ('html5', 'html')">
    <xsl:call-template name="microdata"/>
  </xsl:if>
</xsl:template>
Stylesheet location html.xsl
Template makeInline
Documentation

Description

what to do with an inline object
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace
after No namespace
before No namespace
style No namespace
Import precedence 14
Source
<xsl:template name="makeInline">
  <xsl:param name="before"/>
  <xsl:param name="after"/>
  <xsl:param name="style"/>
  <xsl:element name="{if ($style='sup') then 'sup' else if       ($style='sub') then 'sub' else 'span'}">
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="default" select="$style"/>
    </xsl:call-template>
    <xsl:if test="@xml:id">
      <xsl:attribute name="id">
        <xsl:value-of select="@xml:id"/>
      </xsl:attribute>
    </xsl:if>
    <xsl:value-of select="$before"/>
    <xsl:apply-templates/>
    <xsl:value-of select="$after"/>
  </xsl:element>
</xsl:template>
Stylesheet location html.xsl
Template makeDelimiter
Documentation

Description

[html] creates a span with a class of delim (and optionally others) to wrap delimiting text to allow users to remove/hide delimiters for whatever reason (e.g. to use CSS pseudo elements instead).

Parameters

string The text content of the delimiter (e.g. <)
classes A sequence of additional class names to be added to the produced span. (e.g. "start")

Return

A span element containing a delimiter:
      <span class="delim start">{{{{</span>
    
Namespace No namespace
Used by
Templates
Parameters
QName Namespace Type
classes No namespace xs:string*
string No namespace xs:string
Import precedence 14
Source
<xsl:template name="makeDelimiter">
  <xsl:param name="string" as="xs:string"/>
  <xsl:param name="classes" as="xs:string*"/>
  <xsl:element name="span">
    <xsl:attribute name="class" select="string-join(('delim', $classes),' ')"/>
    <xsl:sequence select="$string"/>
  </xsl:element>
</xsl:template>
Stylesheet location html.xsl
Template horizontalRule
Documentation

Description

how to make a horizontal rule
Namespace No namespace
Used by
Template
Import precedence 14
Source
<xsl:template name="horizontalRule">
  <hr/>
</xsl:template>
Stylesheet location html.xsl
Template makeBlock
Documentation

Description

what to do with a block-level object
Namespace No namespace
Used by
References
Parameters
QName Namespace
style No namespace
Import precedence 14
Source
<xsl:template name="makeBlock">
  <xsl:param name="style"/>
  <xsl:element name="{if (tei:isInline(.)) then 'span' else 'div'}">
    <xsl:call-template name="microdata"/>
    <xsl:call-template name="makeRendition">
      <xsl:with-param name="default" select="$style"/>
    </xsl:call-template>
    <xsl:if test="@xml:id">
      <xsl:attribute name="id">
        <xsl:value-of select="@xml:id"/>
      </xsl:attribute>
    </xsl:if>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>
Stylesheet location html.xsl
Template makeSection
Documentation

Description

Section-like object
Namespace No namespace
Used by
Supersedes
Template
Parameters
QName Namespace
heading No namespace
implicitBlock No namespace
level No namespace
Import precedence 14
Source
<xsl:template name="makeSection">
  <xsl:param name="level"/>
  <xsl:param name="heading"/>
  <xsl:param name="implicitBlock">false</xsl:param>
  <xsl:element name="h{$level + 2}">
    <xsl:value-of select="$heading"/>
  </xsl:element>
  <xsl:choose>
    <xsl:when test="$implicitBlock='true'">
      <p>
        <xsl:apply-templates/>
      </p>
    </xsl:when>
    <xsl:when test="*">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <p>
        <xsl:apply-templates/>
      </p>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location html.xsl
Template makeWithLabel
Namespace No namespace
Used by
Supersedes
Template
Parameters
QName Namespace
before No namespace
Import precedence 14
Source
<xsl:template name="makeWithLabel">
  <xsl:param name="before"/>
  <i>
    <xsl:value-of select="$before"/>
  </i>
  <xsl:text>: </xsl:text>
  <xsl:value-of select="normalize-space(.)"/>
</xsl:template>
Stylesheet location html.xsl
Template *ident
Documentation

Description

Process any element and work out a unique identifying string
Namespace No namespace
Match *
Mode ident
References
Variable
Template
Parameter
Import precedence 14
Source
<xsl:template match="*" mode="ident">
  <xsl:variable name="BaseFile">
    <xsl:value-of select="$masterFile"/>
    <xsl:call-template name="addCorpusID"/>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="@xml:id and $useIDs='true'">
      <xsl:value-of select="@xml:id"/>
    </xsl:when>
    <xsl:when test="starts-with(local-name(.),'div') or                       self::tei:text">
      <xsl:variable name="xpath">
        <xsl:for-each select="ancestor-or-self::tei:*">
          <xsl:value-of select="local-name()"/>
          <xsl:text>.</xsl:text>
          <xsl:number/>
          <xsl:if test="not(position() = last())">
            <xsl:text>_</xsl:text>
          </xsl:if>
        </xsl:for-each>
      </xsl:variable>
      <xsl:value-of select="$BaseFile"/>
      <xsl:text>-</xsl:text>
      <xsl:value-of select="substring-after(substring-after($xpath,'_text.'),'_')"/>
    </xsl:when>
    <xsl:when test="self::tei:TEI and parent::tei:teiCorpus">
      <xsl:value-of select="$masterFile"/>
      <xsl:call-template name="addCorpusID"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:sequence select="concat($BaseFile,'-',local-name(),'-',generate-id())"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location html.xsl
Template *generateLink
Documentation
Namespace No namespace
Match *
Mode generateLink
References
Import precedence 14
Source
Stylesheet location html.xsl
Template tei:TEIgenerateLink
Documentation
Namespace No namespace
Match tei:TEI
Mode generateLink
References
Import precedence 14
Source
Stylesheet location html.xsl
Template tei:*maketoc
Documentation

Description

Process elements tei:* in toc mode

anything with a head can go in the TOC

Parameters

forcedepth forcedepth
Namespace No namespace
Match tei:*
Mode maketoc
References
Parameters
QName Namespace
forcedepth No namespace
Import precedence 14
Source
<xsl:template match="tei:*" mode="maketoc">
  <xsl:param name="forcedepth"/>
  <xsl:variable name="myName">
    <xsl:value-of select="local-name(.)"/>
  </xsl:variable>
  <xsl:if test="tei:head or $autoHead='true'">
    <xsl:variable name="Depth">
      <xsl:choose>
        <xsl:when test="not($forcedepth='')">
          <xsl:value-of select="$forcedepth"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$tocDepth"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="thislevel">
      <xsl:choose>
        <xsl:when test="$myName = 'div'">
          <xsl:value-of select="count(ancestor::tei:div)"/>
        </xsl:when>
        <xsl:when test="starts-with($myName,'div')">
          <xsl:value-of select="number(substring-after($myName,'div')) - 1"/>
        </xsl:when>
        <xsl:otherwise>99</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="pointer">
      <xsl:apply-templates mode="generateLink" select="."/>
    </xsl:variable>
    <li>
      <xsl:attribute name="class">
        <xsl:text>toc</xsl:text>
        <xsl:if test="not($autoHead='true') and not(tei:head or @n)"> headless</xsl:if>
        <xsl:if test=".//m:math and  $outputTarget='epub3'">
          <xsl:attribute name="class"> contains-mathml</xsl:attribute>
        </xsl:if>
      </xsl:attribute>
      <xsl:call-template name="header">
        <xsl:with-param name="toc" select="$pointer"/>
        <xsl:with-param name="minimal">false</xsl:with-param>
        <xsl:with-param name="display">plain</xsl:with-param>
      </xsl:call-template>
      <xsl:if test="$thislevel < $Depth">
        <xsl:call-template name="continuedToc"/>
      </xsl:if>
    </li>
  </xsl:if>
</xsl:template>
Stylesheet location html.xsl
Template tei:label|tei:figure|tei:table|tei:item|tei:p|tei:title|tei:bibl|tei:anchor|tei:cell|tei:lg|tei:list|tei:spgenerateLink
Documentation
Namespace No namespace
Match tei:label|tei:figure|tei:table|tei:item|tei:p|tei:title|tei:bibl|tei:anchor|tei:cell|tei:lg|tei:list|tei:sp
Mode generateLink
Import precedence 14
Source
Stylesheet location html.xsl
Template tei:notegenerateLink
Documentation
Namespace No namespace
Match tei:note
Mode generateLink
References
Import precedence 14
Source
Stylesheet location html.xsl
Template generateEndLink
Documentation
where where
Namespace No namespace
Used by
Parameters
Import precedence 14
Source
Stylesheet location html.xsl
Template locateParentDiv
Documentation

Description

[html] Find the name of the outermost container for the current object which would create an output file
Namespace No namespace
Used by
References
Parameter
Import precedence 14
Source
<xsl:template name="locateParentDiv">
  <xsl:choose>
    <xsl:when test="ancestor-or-self::tei:body/parent::tei:text/ancestor::tei:group">
      <xsl:apply-templates mode="ident" select="ancestor::tei:text[1]"/>
    </xsl:when>
    <xsl:when test="ancestor-or-self::tei:front/parent::tei:text/ancestor::tei:group">
      <xsl:apply-templates mode="ident" select="ancestor::tei:text[1]"/>
    </xsl:when>
    <xsl:when test="ancestor-or-self::tei:back/parent::tei:text/ancestor::tei:group">
      <xsl:apply-templates mode="ident" select="ancestor::tei:text[1]"/>
    </xsl:when>
    <xsl:when test="ancestor-or-self::tei:div and number($splitLevel) < 0">
      <xsl:apply-templates mode="ident" select="ancestor::tei:div[last()]"/>
    </xsl:when>
    <xsl:when test="ancestor-or-self::tei:div">
      <xsl:variable name="ancestors" select="count(ancestor-or-self::tei:div)"/>
      <xsl:variable name="diff" select="$ancestors - number($splitLevel)"/>
      <xsl:variable name="what" select="if ($diff <= 1) then 1           else $diff "/>
      <xsl:apply-templates mode="ident" select="ancestor-or-self::tei:div[$what]"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="ancestors" select="count(ancestor::tei:*[local-name()='div1'           or local-name()='div2'           or local-name()='div3'           or local-name()='div4'           or local-name()='div5'           or local-name()='div6'])"/>
      <xsl:variable name="what" select="if           ($ancestors < number($splitLevel)) then 1 else           $ancestors - number($splitLevel) +1"/>
      <xsl:apply-templates mode="ident" select="ancestor-or-self::tei:*[local-name()='div1'           or local-name()='div2'           or local-name()='div3'           or local-name()='div4'           or local-name()='div5'           or local-name()='div6'][$what]"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location html.xsl
Template tei:notexref
Documentation

Description

Process cross-ref to note
Namespace No namespace
Match tei:note
Mode xref
Import precedence 14
Source
<xsl:template match="tei:note" mode="xref">
  <xsl:number level="any"/>
</xsl:template>
Stylesheet location html.xsl
Template formatHeadingNumber
Documentation

Description

formatting of the number part of a header
Namespace No namespace
Used by
Template
Supersedes
Parameters
QName Namespace
text No namespace
toc No namespace
Import precedence 14
Source
<xsl:template name="formatHeadingNumber">
  <xsl:param name="text"/>
  <xsl:param name="toc"/>
  <xsl:if test="not($text='')">
    <span class="headingNumber">
      <xsl:copy-of select="$text"/>
    </span>
  </xsl:if>
</xsl:template>
Stylesheet location html.xsl
Template @xml:id
Documentation

Description

General conversion of all xml:id attributes to id attributes in HTML output.
Namespace No namespace
Match @xml:id
Mode #default
Import precedence 14
Source
<xsl:template match="@xml:id">
  <xsl:attribute name="id" select="."/>
</xsl:template>
Stylesheet location html.xsl
Parameter divOffset
Namespace No namespace
Used by
Templates
Supersedes
Parameter
Source
<xsl:param name="divOffset">1</xsl:param>
Stylesheet location html.xsl
Parameter doclang
Namespace No namespace
Used by
Supersedes
Parameter
Source
<xsl:param name="doclang"/>
Stylesheet location html.xsl
Variable masterFile
Documentation

Description

Stylesheet constant setting the name of the main output file.
Namespace No namespace
Used by
References
Parameters
Template
Source
<xsl:variable name="masterFile">
  <xsl:choose>
    <xsl:when test="not($outputName ='')">
      <xsl:choose>
        <xsl:when test="$STDOUT='true'">
          <xsl:value-of select="$outputName"/>
        </xsl:when>
        <xsl:when test="contains($outputName,'.xml')">
          <xsl:value-of select="substring-before($outputName,'.xml')"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$outputName"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:when>
    <xsl:when test="contains($REQUEST,'.ID=')">
      <xsl:call-template name="get-basename">
        <xsl:with-param name="file">
          <xsl:value-of select="substring-before($REQUEST,'.ID=')"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="not($REQUEST='')">
      <xsl:call-template name="get-basename">
        <xsl:with-param name="file">
          <xsl:value-of select="$REQUEST"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$STDOUT='true'">
      <xsl:text>index.xml</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>index</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:variable>
Stylesheet location html.xsl
Function tei:processRendition (value, auto)
. They are either turned directly into @class values, or by following the link to an external document and using the @xml:id from there to make a class.
Documentation

Description

[html] Look up rendition value

Parameters

value value
Namespace http://www.tei-c.org/ns/1.0
Type node()*
Used by
Template
Parameters
QName Namespace
auto No namespace
value No namespace
Import precedence 14
Source
<xsl:function name="tei:processRendition" as="node()*">
  <xsl:param name="value"/>
  <xsl:param name="auto"/>
  <xsl:attribute name="class">
    <xsl:if test="not($auto='')">
      <xsl:value-of select="$auto"/>
      <xsl:text> </xsl:text>
    </xsl:if>
    <xsl:variable name="values">
      <xsl:for-each select="tokenize(normalize-space($value),' ')">
        <xsl:choose>
          <xsl:when test="starts-with(.,'#')">
            <xsl:sequence select="substring-after(.,'#')"/>
          </xsl:when>
          <xsl:when test="starts-with(.,'simple:')">
            <xsl:value-of select="substring(.,8)"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:for-each select="document(.)">
              <xsl:sequence select="@xml:id"/>
            </xsl:for-each>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
    </xsl:variable>
    <xsl:value-of select="string-join($values,' ')"/>
  </xsl:attribute>
</xsl:function>
Stylesheet location html.xsl
Function tei:processRend (value, auto, context)
Documentation

Description

[html] Look up @rend value. We recognize some simple cases, and turn them into an "s" element, otherwise we use the @rend to make a "c" element. The "s" and "c" are processed into appropriate @class and @style attributes at the end. The special cases for super and subscript have been dealt with separately, so ignore them.
Namespace http://www.tei-c.org/ns/1.0
Type node()*
Used by
Template
Parameters
QName Namespace
auto No namespace
context No namespace
value No namespace
Import precedence 14
Source
<xsl:function name="tei:processRend" as="node()*">
  <xsl:param name="value"/>
  <xsl:param name="auto"/>
  <xsl:param name="context"/>
  <xsl:variable name="values">
    <values xmlns="">
      <xsl:if test="not($auto='')">
        <c>
          <xsl:value-of select="$auto"/>
        </c>
      </xsl:if>
      <xsl:for-each select="tokenize($context/@style,';')">
        <s>
          <xsl:value-of select="."/>
        </s>
      </xsl:for-each>
      <xsl:for-each select="tokenize(normalize-space($value),' ')">
        <xsl:choose>
          <xsl:when test=".='calligraphic' or .='cursive'">
            <s>font-family:cursive</s></xsl:when>
          <xsl:when test=".='center' or .='centered' or .='centred'">
            <s>text-align: center</s></xsl:when>
          <xsl:when test=".='expanded'">
            <s>letter-spacing: 0.15em</s></xsl:when>
          <xsl:when test=".='gothic'">
            <s>font-family: Papyrus, fantasy</s></xsl:when>
          <xsl:when test=".='indent'">
            <s>text-indent: 5em</s></xsl:when>
          <xsl:when test=".='large'">
            <s>font-size: 130%</s></xsl:when>
          <xsl:when test=".='larger'">
            <s>font-size: 200%</s></xsl:when>
          <xsl:when test=".='overbar'">
            <s>text-decoration:overline</s></xsl:when>
          <xsl:when test=".='plain'"/>
          <xsl:when test=".='ro' or .='roman'">
            <s>font-style: normal</s></xsl:when>
          <xsl:when test=".='sc' or .='smcap' or .='smallcaps'">
            <s>font-variant: small-caps</s></xsl:when>
          <xsl:when test=".='small'">
            <s>font-size: 75%</s></xsl:when>
          <xsl:when test=".='smaller'">
            <s>font-size: 50%</s></xsl:when>
          <xsl:when test=".='spaced'">
            <s>letter-spacing: 0.15em</s></xsl:when>
          <xsl:when test=".='sub' or .='sup' or .='code' or   .='superscript' or .='subscript'"/>
          <xsl:when test="starts-with(.,'background(')">
            <s>
              <xsl:text>background-color:</xsl:text>
              <xsl:value-of select="substring-before(substring-after(.,'('),')')"/>
            </s>
          </xsl:when>
          <xsl:when test="starts-with(.,'align(')">
            <s>
              <xsl:text>text-align:</xsl:text>
              <xsl:value-of select="substring-before(substring-after(.,'('),')')"/>
            </s>
          </xsl:when>
          <xsl:when test="starts-with(.,'color(')">
            <s>
              <xsl:text>color:</xsl:text>
              <xsl:value-of select="substring-before(substring-after(.,'('),')')"/>
            </s>
          </xsl:when>
          <xsl:when test="starts-with(.,'post(')">
            <xsl:message terminate="yes">no support for post() pattern in @rend</xsl:message></xsl:when>
          <xsl:when test="starts-with(.,'pre(')">
            <xsl:message terminate="yes">no support for pre() pattern in  @rend</xsl:message></xsl:when>
          <xsl:when test=".='bold' or . ='b'">
            <s>font-weight:bold</s></xsl:when>
          <xsl:when test=".='italic' or .='i'">
            <s>font-style:italic</s></xsl:when>
          <xsl:when test=".='strikethrough' or .='strike'">
            <s>text-decoration: line-through</s></xsl:when>
          <xsl:when test=".='underline'">
            <s>text-decoration:underline</s></xsl:when>
          <xsl:otherwise>
            <c>
              <xsl:value-of select="."/>
            </c>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
    </values>
  </xsl:variable>
  <xsl:if test="$values/values/c">
    <xsl:attribute name="class">
      <xsl:value-of select="$values/values/c" separator=" "/>
    </xsl:attribute>
  </xsl:if>
  <xsl:if test="$values/values/s">
    <xsl:attribute name="style">
      <xsl:value-of select="$values/values/s" separator=";"/>
    </xsl:attribute>
  </xsl:if>
</xsl:function>
Stylesheet location html.xsl
Function tei:processStyle (value)
Documentation

Description

[html] Process @style attribute. It is simply mapped to an HTML @style attribute. If it is not using CSS, that will fail.
Namespace http://www.tei-c.org/ns/1.0
Type node()*
Used by
Template
Parameters
QName Namespace
value No namespace
Import precedence 14
Source
<xsl:function name="tei:processStyle" as="node()*">
  <xsl:param name="value"/>
  <xsl:attribute name="style">
    <xsl:value-of select="$value"/>
  </xsl:attribute>
</xsl:function>
Stylesheet location html.xsl
Function tei:isDivOrP (element)
Documentation

Description

Is given a TEI paragraph element and says what the HTML wrapper element should be (ie plain <p> or <div class="p"> if the content is complex).
Namespace http://www.tei-c.org/ns/1.0
Type node()*
Used by
Template
References
Parameters
QName Namespace
element No namespace
Import precedence 14
Source
<xsl:function name="tei:isDivOrP" as="node()*">
  <xsl:param name="element"/>
  <xsl:for-each select="$element">
    <xsl:choose>
      <xsl:when test="tei:specList">div</xsl:when>
      <xsl:when test="parent::tei:note[@place='display']">div</xsl:when>
      <xsl:when test="parent::tei:note[@place='block']">div</xsl:when>
      <xsl:when test="parent::tei:figure and (tei:q/tei:l or tei:figure or parent::tei:figure/parent::tei:div)">div</xsl:when>
      <xsl:when test="ancestor::tei:notesStmt">div</xsl:when>
      <xsl:when test="tei:table">div</xsl:when>
      <xsl:when test="$outputTarget='epub' or $outputTarget='epub3'">div</xsl:when>
      <xsl:when test="tei:eg">div</xsl:when>
      <xsl:when test="tei:figure">div</xsl:when>
      <xsl:when test="tei:floatingText">div</xsl:when>
      <xsl:when test="tei:l">div</xsl:when>
      <xsl:when test="tei:list">div</xsl:when>
      <xsl:when test="tei:moduleSpec">div</xsl:when>
      <xsl:when test="tei:note[@place='display'  or @place='block' or tei:isMarginal(@place)]">div</xsl:when>
      <xsl:when test="tei:note[tei:q]">div</xsl:when>
      <xsl:when test="tei:q/tei:figure">div</xsl:when>
      <xsl:when test="tei:q/tei:list">div</xsl:when>
      <xsl:when test="tei:q[tei:match(@rend,'display')]">div</xsl:when>
      <xsl:when test="tei:q[tei:match(@rend,'inline') and tei:note/@place]">div</xsl:when>
      <xsl:when test="tei:q[tei:l]">div</xsl:when>
      <xsl:when test="tei:q[tei:lg]">div</xsl:when>
      <xsl:when test="tei:q[tei:p]">div</xsl:when>
      <xsl:when test="tei:q[tei:sp]">div</xsl:when>
      <xsl:when test="tei:q[tei:floatingText]">div</xsl:when>
      <xsl:when test="tei:quote[not(tei:isInline(.))]">div</xsl:when>
      <xsl:when test="tei:specGrp">div</xsl:when>
      <xsl:when test="tei:specGrpRef">div</xsl:when>
      <xsl:when test="tei:specList">div</xsl:when>
      <xsl:when test="tei:table">div</xsl:when>
      <xsl:when test="teix:egXML">div</xsl:when>
      <xsl:when test="ancestor::tei:floatingText">div</xsl:when>
      <xsl:when test="ancestor::tei:closer">div</xsl:when>
      <xsl:when test="parent::tei:p">div</xsl:when>
      <xsl:when test="parent::tei:q">div</xsl:when>
      <xsl:when test="parent::tei:note">div</xsl:when>
      <xsl:when test="parent::tei:remarks">div</xsl:when>
      <xsl:otherwise>
        <xsl:text>p</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each>
</xsl:function>
Stylesheet location html.xsl
Function tei:processClass (value, auto)
Documentation

Description

[html] Create a class attribute.
Namespace http://www.tei-c.org/ns/1.0
Type node()*
Used by
Template
Parameters
QName Namespace
auto No namespace
value No namespace
Import precedence 14
Source
<xsl:function name="tei:processClass" as="node()*">
  <xsl:param name="value"/>
  <xsl:param name="auto"/>
  <xsl:attribute name="class">
    <xsl:if test="not($auto='')">
      <xsl:value-of select="$auto"/>
      <xsl:text> </xsl:text>
    </xsl:if>
    <xsl:value-of select="$value"/>
  </xsl:attribute>
</xsl:function>
Stylesheet location html.xsl
Function tei:keepDivOnPage (context)
Documentation

Description

whether a div starts a new page
Namespace http://www.tei-c.org/ns/1.0
Type xs:boolean
Used by
References
Parameters
QName Namespace
context No namespace
Import precedence 14
Source
<xsl:function name="tei:keepDivOnPage" as="xs:boolean">
  <xsl:param name="context"/>
  <xsl:for-each select="$context">
    <xsl:choose>
      <!-- 4. we are part of an inner text -->
      <xsl:when test="ancestor::tei:floatingText">true</xsl:when>
      <!-- 3. we have special rendering on the document -->
      <xsl:when test="ancestor::tei:TEI/tei:match(@rend,'all')                          or ancestor::tei:TEI/tei:match(@rend,'frontpage')                          or ancestor::tei:TEI/tei:match(@rend,'nosplit')">true</xsl:when>
      <!-- 2. we are a singleton -->
      <xsl:when test="parent::tei:body[count(*)=1] and not(tei:div or                         tei:div2)">true</xsl:when>
      <!-- 1. we have no preceding sections at top level -->
      <xsl:when test="not(ancestor::tei:group) and parent::tei:body and                         not(parent::tei:body/preceding-sibling::tei:front)                         and not (preceding-sibling::*)">true</xsl:when>
      <!-- 0. we are down the hierarchy -->
      <xsl:when test="tei:match(@rend,'nosplit')">true</xsl:when>
      <xsl:otherwise>false</xsl:otherwise>
    </xsl:choose>
  </xsl:for-each>
</xsl:function>
Stylesheet location html.xsl
Output (default)
Namespace No namespace
Output properties
method encoding indent normalization-form omit-xml-declaration
xhtml no NFC yes
Source
<xsl:output method="xhtml" html-version="5.0" encoding="UTF-8" indent="no" normalization-form="NFC" exclude-result-prefixes="#all" omit-xml-declaration="yes"/>
Stylesheet location html.xsl