Showing:

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

Description

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

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 7899 2010-07-24 21:17:54Z rahtz $

Copyright: 2008, TEI Consortium

Included from
Stylesheet version 2.0
Template *ident
Documentation

Description

rendition elements in the header

Description

Process elements * to work out a unique identififying string
Namespace No namespace
Match *
Mode ident
References
Variable masterFile
Template addCorpusID
Parameter useIDs
Import precedence 3
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:otherwise>
      <xsl:value-of select="$BaseFile"/>
      <xsl:text>-</xsl:text>
      <xsl:value-of select="local-name(.)"/>
      <xsl:text>-</xsl:text>
      <xsl:value-of select="generate-id()"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../xhtml2/linking.xsl
Template *generateLink
Documentation
Namespace No namespace
Match *
Mode generateLink
References
Import precedence 3
Source
Stylesheet location ../../../xhtml2/linking.xsl
Template tei:TEIgenerateLink
Documentation
Namespace No namespace
Match tei:TEI
Mode generateLink
References
Import precedence 3
Source
Stylesheet location ../../../xhtml2/linking.xsl
Template tei:anchor
Documentation

Description

Process element anchor
Namespace No namespace
Match tei:anchor
Mode #default
References
Template makeAnchor
Import precedence 3
Source
<xsl:template match="tei:anchor">
  <xsl:call-template name="makeAnchor"/>
</xsl:template>
Stylesheet location ../../../xhtml2/linking.xsl
Template tei:label|tei:figure|tei:table|tei:item|tei:p|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:bibl|tei:anchor|tei:cell|tei:lg|tei:list|tei:sp
Mode generateLink
Import precedence 3
Source
Stylesheet location ../../../xhtml2/linking.xsl
Template tei:notegenerateLink
Documentation
Namespace No namespace
Match tei:note
Mode generateLink
References
Import precedence 3
Source
Stylesheet location ../../../xhtml2/linking.xsl
Template generateEndLink
Documentation
Namespace No namespace
Used by
References
Parameters
Import precedence 3
Source
Stylesheet location ../../../xhtml2/linking.xsl
Template locateParent
Documentation

Description

[html]
Namespace No namespace
Used by
Template xrefpanel
References
Parameter splitLevel
Import precedence 3
Source
<xsl:template name="locateParent">
  <xsl:choose>
    <xsl:when test="self::tei:div">
      <xsl:apply-templates mode="ident" select="ancestor::tei:div[last() - number($splitLevel) + 1]"/>
    </xsl:when>
    <xsl:when test="ancestor::tei:div">
      <xsl:apply-templates mode="ident" select="ancestor::tei:div[last() - number($splitLevel)]"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:choose>
        <xsl:when test="number($splitLevel) = 0">
          <xsl:apply-templates mode="ident" select="ancestor::tei:div1"/>
        </xsl:when>
        <xsl:when test="number($splitLevel) = 1">
          <xsl:apply-templates mode="ident" select="ancestor::tei:div2|ancestor::tei:div1"/>/></xsl:when>
        <xsl:when test="number($splitLevel) = 2">
          <xsl:apply-templates mode="ident" select="ancestor::tei:div3|ancestor::tei:div2"/>
        </xsl:when>
        <xsl:when test="number($splitLevel) = 3">
          <xsl:apply-templates mode="ident" select="ancestor::tei:div4|ancestor::tei:div3"/>
        </xsl:when>
        <xsl:when test="number($splitLevel) = 4">
          <xsl:apply-templates mode="ident" select="ancestor::tei:div5|ancestor::tei:div4"/>
        </xsl:when>
      </xsl:choose>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../xhtml2/linking.xsl
Template locateParentdiv
Documentation

Description

[html]
Namespace No namespace
Used by
Template *generateLink
References
Parameter splitLevel
Import precedence 3
Source
<xsl:template name="locateParentdiv">
  <xsl:choose>
    <xsl:when test="ancestor-or-self::tei:body[tei:head]/parent::tei:text/parent::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:apply-templates mode="ident" select="ancestor::tei:div[last() - number($splitLevel)]"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:choose>
        <xsl:when test="number($splitLevel) = 0">
          <xsl:apply-templates mode="ident" select="ancestor::tei:div1"/>
        </xsl:when>
        <xsl:when test="number($splitLevel) = 1">
          <xsl:apply-templates mode="ident" select="(ancestor::tei:div2|ancestor::tei:div1)[last()]"/>
        </xsl:when>
        <xsl:when test="number($splitLevel) = 2">
          <xsl:apply-templates mode="ident" select="(ancestor::tei:div3|ancestor::tei:div2)[last()]"/>
        </xsl:when>
        <xsl:when test="number($splitLevel) = 3">
          <xsl:apply-templates mode="ident" select="(ancestor::tei:div4|ancestor::tei:div3)[last()]"/>
        </xsl:when>
        <xsl:when test="number($splitLevel) = 4">
          <xsl:apply-templates mode="ident" select="(ancestor::tei:div5|ancestor::tei:div4)[last()]"/>
        </xsl:when>
      </xsl:choose>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../xhtml2/linking.xsl
Template makeExternalLink
Documentation
Namespace No namespace
Used by
References
Parameters
Import precedence 3
Source
Stylesheet location ../../../xhtml2/linking.xsl
Template makeInternalLink
Documentation
Namespace No namespace
Used by
References
Parameters
Import precedence 3
Source
Stylesheet location ../../../xhtml2/linking.xsl
Template tei:notexref
Documentation

Description

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

Description

formatting of the number part of a header
Namespace No namespace
Used by
Template header
Supersedes
Parameters
QName Namespace
text No namespace
toc No namespace
Import precedence 3
Source
<xsl:template name="formatHeadingNumber">
  <xsl:param name="text"/>
  <xsl:param name="toc"/>
  <span class="headingNumber">
    <xsl:copy-of select="$text"/>
  </span>
</xsl:template>
Stylesheet location ../../../xhtml2/linking.xsl