Showing:

Documentation
Parameters
Used by
References
Included from
Source
Stylesheet linking.xsl
Documentation

Description

TEI stylesheet dealing with elements from the linking module.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Author: See AUTHORS

Id: $Id: linking.xsl 9490 2011-10-10 19:43:23Z sbauman $

Copyright: 2011, TEI Consortium

Included from
Stylesheet version 2.0
Template tei:TEIxref
Documentation

Description

Process element in xref mode
Namespace No namespace
Match tei:TEI
Mode xref
Import precedence 1
Source
<xsl:template match="tei:TEI" mode="xref">
  <xsl:apply-templates select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[1]"/>
</xsl:template>
Stylesheet location ../common2/linking.xsl
Template tei:textxref
Documentation

Description

Process elements text in xref mode
Namespace No namespace
Match tei:text
Mode xref
Import precedence 1
Source
<xsl:template match="tei:text" mode="xref">
  <xsl:choose>
    <xsl:when test="tei:head">
      <xsl:apply-templates select="tei:head" mode="plain"/>
    </xsl:when>
    <xsl:when test="tei:body/tei:head">
      <xsl:apply-templates select="tei:body/tei:head" mode="plain"/>
    </xsl:when>
    <xsl:when test="tei:front//tei:titlePart/tei:title">
      <xsl:apply-templates select="tei:front//tei:titlePart/tei:titl" mode="plain"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>Text </xsl:text>
      <xsl:number/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/linking.xsl
Template tei:anchor|tei:pxref
Documentation

Description

Process element anchor|tei:p in xref mode
Namespace No namespace
Match tei:anchor|tei:p
Mode xref
Import precedence 1
Source
<xsl:template match="tei:anchor|tei:p" mode="xref">
  <xsl:text>here</xsl:text>
</xsl:template>
Stylesheet location ../common2/linking.xsl
Template tei:biblxref
Documentation

Description

Process element bibl
Namespace No namespace
Match tei:bibl
Mode xref
Import precedence 1
Source
<xsl:template match="tei:bibl" mode="xref">
  <xsl:text>[</xsl:text>
  <xsl:number/>
  <xsl:text>]</xsl:text>
</xsl:template>
Stylesheet location ../common2/linking.xsl
Template tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6xref
Documentation

Description

Process element s tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6 in xref mode

Parameters

minimal whether to make a link with just numbers or with text too

Namespace No namespace
Match tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6
Mode xref
References
Template header
Parameters
QName Namespace
minimal No namespace
Import precedence 1
Source
<xsl:template match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5|tei:div6" mode="xref">
  <xsl:param name="minimal">false</xsl:param>
  <xsl:call-template name="header">
    <xsl:with-param name="minimal" select="$minimal"/>
    <xsl:with-param name="display">plain</xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../common2/linking.xsl
Template tei:ptr
Documentation

Description

Process element ptr in xref mode
Namespace No namespace
Match tei:ptr
Mode #default
References
Template makeTEILink
Import precedence 1
Source
<xsl:template match="tei:ptr">
  <xsl:call-template name="makeTEILink">
    <xsl:with-param name="ptr" select="true()"/>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../common2/linking.xsl
Template tei:ref
Documentation

Description

Process element ref
Namespace No namespace
Match tei:ref
Mode #default
References
Template makeTEILink
Import precedence 1
Source
<xsl:template match="tei:ref">
  <xsl:call-template name="makeTEILink">
    <xsl:with-param name="ptr" select="false()"/>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../common2/linking.xsl
Template header
Documentation

Description

[common] Making a heading for something

Parameters

minimal whether to display headings

toc whether this is making a TOC entry

display detail of display (full, simple, plain), ie whether markup is followed

Namespace No namespace
Used by
References
Parameters
QName Namespace
display No namespace
minimal No namespace
toc No namespace
Import precedence 1
Source
<xsl:template name="header">
  <xsl:param name="minimal">false</xsl:param>
  <xsl:param name="toc"/>
  <xsl:param name="display">full</xsl:param>
  <xsl:variable name="depth">
    <xsl:apply-templates mode="depth" select="."/>
  </xsl:variable>
  <xsl:call-template name="formatHeadingNumber">
    <xsl:with-param name="toc">
      <xsl:value-of select="$toc"/>
    </xsl:with-param>
    <xsl:with-param name="text">
      <xsl:choose>
        <xsl:when test="local-name(.) = 'TEI'"/>
        <xsl:when test="$depth > $numberHeadingsDepth">
        </xsl:when>
        <xsl:when test="self::tei:text">
          <xsl:number/>
          <xsl:call-template name="headingNumberSuffix"/>
        </xsl:when>
        <xsl:when test="ancestor::tei:back">
          <xsl:if test="$numberBackHeadings='true'">
            <xsl:call-template name="i18n">
              <xsl:with-param name="word">appendixWords</xsl:with-param>
            </xsl:call-template>
            <xsl:text> </xsl:text>
            <xsl:call-template name="numberBackDiv"/>
            <xsl:if test="$minimal='false'">
              <xsl:value-of select="$numberSpacer"/>
            </xsl:if>
          </xsl:if>
        </xsl:when>
        <xsl:when test="ancestor::tei:front">
          <xsl:if test="$numberFrontHeadings='true'">
            <xsl:call-template name="numberFrontDiv">
              <xsl:with-param name="minimal">
                <xsl:value-of select="$minimal"/>
              </xsl:with-param>
            </xsl:call-template>
          </xsl:if>
        </xsl:when>
        <xsl:when test="$numberHeadings ='true'">
          <xsl:choose>
            <xsl:when test="$prenumberedHeadings='true'">
              <xsl:value-of select="@n"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:call-template name="numberBodyDiv"/>
            </xsl:otherwise>
          </xsl:choose>
          <xsl:if test="$minimal='false'">
            <xsl:call-template name="headingNumberSuffix"/>
          </xsl:if>
        </xsl:when>
      </xsl:choose>
    </xsl:with-param>
  </xsl:call-template>
  <xsl:if test="$minimal='false'">
    <xsl:choose>
      <xsl:when test="local-name(.) = 'TEI'">
        <xsl:apply-templates select="tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[1]"/>
      </xsl:when>
      <xsl:when test="not($toc='')">
        <xsl:call-template name="makeInternalLink">
          <xsl:with-param name="dest">
            <xsl:value-of select="$toc"/>
          </xsl:with-param>
          <xsl:with-param name="class">
            <xsl:value-of select="$class_toc"/>
            <xsl:text> </xsl:text>
            <xsl:value-of select="concat($class_toc,'_',$depth)"/>
          </xsl:with-param>
          <xsl:with-param name="body">
            <xsl:choose>
              <xsl:when test="not(tei:head) and tei:body/tei:head">
                <xsl:apply-templates mode="plain" select="tei:body/tei:head"/>
              </xsl:when>
              <xsl:when test="not(tei:head) and tei:front//tei:titlePart/tei:title">
                <xsl:apply-templates mode="plain" select="tei:front//tei:titlePart/tei:title"/>
              </xsl:when>
              <xsl:when test="tei:head">
                <xsl:apply-templates mode="plain" select="tei:head"/>
              </xsl:when>
              <xsl:when test="$autoHead='true'">
                <xsl:call-template name="autoMakeHead">
                  <xsl:with-param name="display" select="$display"/>
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:number/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="$autoHead='true'">
        <xsl:choose>
          <xsl:when test="$outputTarget='epub' and     not(tei:head)"/>
          <xsl:otherwise>
            <xsl:call-template name="autoMakeHead">
              <xsl:with-param name="display" select="$display"/>
            </xsl:call-template>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>
      <xsl:when test="$display='plain'">
        <xsl:for-each select="tei:head">
          <xsl:apply-templates mode="plain"/>
        </xsl:for-each>
      </xsl:when>
      <xsl:when test="$display='simple'">
        <xsl:for-each select="tei:head">
          <xsl:apply-templates mode="plain"/>
        </xsl:for-each>
      </xsl:when>
      <xsl:when test="self::tei:index">
        <xsl:value-of select="substring(tei:term,1,10)"/>
        <xsl:text></xsl:text>
      </xsl:when>
      <xsl:when test="not(tei:head)">
        <xsl:value-of select="substring(normalize-space(.),1,10)"/>
        <xsl:text></xsl:text>
      </xsl:when>
      <xsl:otherwise>
        <xsl:apply-templates select="tei:head" mode="makeheading"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location ../common2/linking.xsl
Template formatHeadingNumber
Documentation

Description

[common] processing the number portion of a heading

By default, the text is printed as is. You may wish to colour it, align it, etc

Parameters

text

Namespace No namespace
Used by
Template header
Parameters
QName Namespace
text No namespace
toc No namespace
Import precedence 1
Source
<xsl:template name="formatHeadingNumber">
  <xsl:param name="text"/>
  <xsl:param name="toc"/>
  <xsl:copy-of select="$text"/>
</xsl:template>
Stylesheet location ../common2/linking.xsl
Template headerLink
Documentation
Namespace No namespace
References
Parameters
Import precedence 1
Source
Stylesheet location ../common2/linking.xsl
Template makeTEILink
Documentation
Namespace No namespace
Used by
References
Parameters
Import precedence 1
Source
Stylesheet location ../common2/linking.xsl