Mode:

Compact lists

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 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 All rights reserved. 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

Id: $Id: linking.xsl 10055 2012-01-20 18:46:11Z rahtz $

Copyright: 2011, TEI Consortium

Included from
Stylesheet version 2.0
Template *ident
Documentation

Description

Process any element and work out a unique identififying string
Namespace No namespace
Match *
Mode ident
References
Variable
Template
Parameter
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:when test="self::tei:TEI and parent::tei:teiCorpus">
      <xsl:value-of select="$masterFile"/>
      <xsl:call-template name="addCorpusID"/>
    </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 linking.xsl
Template *generateLink
Documentation
Namespace No namespace
Match *
Mode generateLink
References
Import precedence 3
Source
Stylesheet location linking.xsl
Template tei:TEIgenerateLink
Documentation
Namespace No namespace
Match tei:TEI
Mode generateLink
References
Import precedence 3
Source
Stylesheet location linking.xsl
Template tei:anchor
Documentation

Description

Process element anchor
Namespace No namespace
Match tei:anchor
Mode #default
References
Template
Import precedence 3
Source
<xsl:template match="tei:anchor">
  <xsl:call-template name="makeAnchor"/>
</xsl:template>
Stylesheet location 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 linking.xsl
Template tei:notegenerateLink
Documentation
Namespace No namespace
Match tei:note
Mode generateLink
References
Import precedence 3
Source
Stylesheet location linking.xsl
Template generateEndLink
Documentation
where where
Namespace No namespace
Used by
Parameters
Import precedence 3
Source
Stylesheet location linking.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 3
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 linking.xsl
Template makeExternalLink
Documentation
ptr ptr dest dest class class
Namespace No namespace
Used by
References
Parameters
Import precedence 3
Source
Stylesheet location linking.xsl
Template makeInternalLink
Documentation
target target ptr ptr dest dest body body class class
Namespace No namespace
Used by
References
Parameters
Import precedence 3
Source
Stylesheet location 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 linking.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 3
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 linking.xsl