Showing:

Documentation
Parameters
Used by
References
Supersedes
Imported modules
Imported from
Source
Stylesheet tei-to-epub.xsl
Documentation

Description

TEI stylesheet for making ePub output. A lot learnt from http://www.hxa.name/articles/content/epub-guide_hxa7241_2007.html and the stylesheets of the NZETC.

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: tei-to-epub.xsl 7897 2010-07-24 18:05:22Z rahtz $

Copyright: 2008, TEI Consortium

Imported modules
Imported from
Stylesheet version 2.0
Template stdfooter
Documentation

Description

[epub] Suppress normal page footer
Namespace No namespace
Used by
Supersedes
Template stdfooter
Parameters
QName Namespace
file No namespace
Import precedence 4
Source
<xsl:template name="stdfooter">
  <xsl:param name="file"/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template generateLicence
Documentation

Description

[epub] Set licence
Namespace No namespace
Used by
Template processTEI
Import precedence 4
Source
<xsl:template name="generateLicence">
  <xsl:text>Creative Commons Attribution</xsl:text>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template generateLanguage
Documentation

Description

[epub] Set language
Namespace No namespace
Used by
Template processTEI
Import precedence 4
Source
<xsl:template name="generateLanguage">
  <xsl:choose>
    <xsl:when test="@xml:lang">
      <xsl:value-of select="@xml:lang"/>
    </xsl:when>
    <xsl:when test="tei:text/@xml:lang">
      <xsl:value-of select="tei:text/@xml:lang"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>en</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template generateSubject
Documentation

Description

[epub] Set subject
Namespace No namespace
Used by
Template processTEI
References
Parameter subject
Import precedence 4
Source
<xsl:template name="generateSubject">
  <xsl:choose>
    <xsl:when test="$subject=''">
      <xsl:text>TEI Text</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$subject"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template generatePublisher
Documentation

Description

[epub] Set name of publisher
Namespace No namespace
Used by
Template processTEI
References
Parameter publisher
Import precedence 4
Source
<xsl:template name="generatePublisher">
  <xsl:choose>
    <xsl:when test="not($publisher='')">
      <xsl:value-of select="$publisher"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="normalize-space(tei:teiHeader/tei:fileDesc/tei:publicationStmt)"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template generateID
Documentation

Description

[epub] Set unique identifier for output
Namespace No namespace
Used by
Template processTEI
References
Parameter uid
Import precedence 4
Source
<xsl:template name="generateID">
  <xsl:choose>
    <xsl:when test="$uid=''">
      <xsl:text>http://www.example.com/TEIEPUB/</xsl:text>
      <xsl:value-of select="format-dateTime(current-dateTime(),'[Y][M02][D02][H02][M02][s02]')"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$uid"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template includeCSS
Documentation

Description

[epub] Override addition of CSS links. We force a simple name of "stylesheet.css"
Namespace No namespace
Used by
References
Parameter cssPrintFile
Supersedes
Template includeCSS
Import precedence 4
Source
<xsl:template name="includeCSS">
  <link xmlns="http://www.w3.org/1999/xhtml" href="stylesheet.css" rel="stylesheet" type="text/css"/>
  <xsl:if test="not($cssPrintFile='')">
    <link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" media="print" type="text/css" href="print.css"/>
  </xsl:if>
  <link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" type="application/vnd.adobe-page-template+xml" href="page-template.xpgt"/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template /
Documentation

Description

(extensible) wrapper for root element
Namespace No namespace
Match /
Mode #default
References
Template processTEI
Supersedes
Template /
Import precedence 4
Source
<xsl:template match="/">
  <xsl:call-template name="processTEI"/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template processTEI
Documentation

Description

[epub] Override of top-level template. This does most of the work: performing the normal transformation, fixing the links to graphics files so that they are all relative, creating the extra output files, etc
Namespace No namespace
Used by
Templates /; /
References
Supersedes
Template processTEI
Import precedence 4
Source
<xsl:template name="processTEI">
  <xsl:variable name="stage1">
    <xsl:apply-templates mode="fixgraphics"/>
  </xsl:variable>
  <xsl:for-each select="$stage1">
    <xsl:apply-templates mode="split"/>
    <xsl:for-each select="*">
      <xsl:variable name="TOC">
        <TOC xmlns="http://www.w3.org/1999/xhtml">
          <xsl:call-template name="mainTOC"/>
        </TOC>
      </xsl:variable>
      <!--
	    <xsl:result-document href="/tmp/TOC">
	    <xsl:copy-of select="$TOC"/>
	    </xsl:result-document>
	-->
      <xsl:if test="$debug='true'">
        <xsl:message>write file OEBPS/stylesheet.css</xsl:message>
      </xsl:if>
      <xsl:result-document method="text" href="{concat($directory,'OEBPS/stylesheet.css')}">
        <xsl:if test="$debug='true'">
          <xsl:message>reading file
            <xsl:value-of select="$cssFile"/>
          </xsl:message>
        </xsl:if>
        <xsl:for-each select="tokenize(unparsed-text($cssFile),     '\r?\n')">
          <xsl:call-template name="purgeCSS"/>
        </xsl:for-each>
        <xsl:if test="$odd='true'">
          <xsl:if test="$debug='true'">
            <xsl:message>reading file
              <xsl:value-of select="$cssODDFile"/>
            </xsl:message>
          </xsl:if>
          <xsl:for-each select="tokenize(unparsed-text($cssODDFile),         '\r?\n')">
            <xsl:call-template name="purgeCSS"/>
          </xsl:for-each>
        </xsl:if>
      </xsl:result-document>
      <xsl:if test="$debug='true'">
        <xsl:message>write file OEBPS/print.css</xsl:message>
      </xsl:if>
      <xsl:result-document method="text" href="{concat($directory,'OEBPS/print.css')}">
        <xsl:if test="$debug='true'">
          <xsl:message>reading file
            <xsl:value-of select="$cssPrintFile"/>
          </xsl:message>
        </xsl:if>
        <xsl:for-each select="tokenize(unparsed-text($cssPrintFile),     '\r?\n')">
          <xsl:call-template name="purgeCSS"/>
        </xsl:for-each>
      </xsl:result-document>
      <xsl:if test="$debug='true'">
        <xsl:message>write file mimetype</xsl:message>
      </xsl:if>
      <xsl:result-document method="text" href="{concat($directory,'mimetype')}">
        <xsl:text>application/epub+zip</xsl:text>
      </xsl:result-document>
      <xsl:if test="$debug='true'">
        <xsl:message>write file META-INF/container.xml</xsl:message>
      </xsl:if>
      <xsl:result-document method="xml" href="{concat($directory,'META-INF/container.xml')}">
        <container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">
          <rootfiles>
            <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
          </rootfiles>
        </container>
      </xsl:result-document>
      <xsl:if test="$debug='true'">
        <xsl:message>write file OEBPS/content.opf</xsl:message>
      </xsl:if>
      <xsl:result-document href="{concat($directory,'OEBPS/content.opf')}" method="xml">
        <package xmlns="http://www.idpf.org/2007/opf" unique-identifier="dcidid" version="2.0">
          <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf">
            <dc:title>
              <xsl:call-template name="generateSimpleTitle"/>
            </dc:title>
            <dc:language xsi:type="dcterms:RFC3066">
              <xsl:call-template name="generateLanguage"/>
            </dc:language>
            <dc:subject>
              <xsl:call-template name="generateSubject"/>
            </dc:subject>
            <dc:identifier id="dcidid" opf:scheme="URI">
              <xsl:call-template name="generateID"/>
            </dc:identifier>
            <dc:creator>
              <xsl:call-template name="generateAuthor"/>
            </dc:creator>
            <dc:publisher>
              <xsl:call-template name="generatePublisher"/>
            </dc:publisher>
            <dc:date xsi:type="dcterms:W3CDTF">
              <xsl:call-template name="generateDate"/>
            </dc:date>
            <dc:rights>
              <xsl:call-template name="generateLicence"/>
            </dc:rights>
            <xsl:if test="not($coverimage='')">
              <meta name="cover" content="cover-image"/>
            </xsl:if>
          </metadata>
          <manifest>
            <xsl:if test="not($coverimage='')">
              <item href="{$coverimage}" id="cover-image" media-type="image/jpeg"/>
            </xsl:if>
            <item href="stylesheet.css" id="css" media-type="text/css"/>
            <item href="titlepage.html" id="titlepage" media-type="application/xhtml+xml"/>
            <item href="titlepageback.html" id="titlepageback" media-type="application/xhtml+xml"/>
            <item id="print.css" href="print.css" media-type="text/css"/>
            <item id="apt" href="page-template.xpgt" media-type="application/adobe-page-template+xml"/>
            <item id="start" href="index.html" media-type="application/xhtml+xml"/>
            <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
              <xsl:if test="html:a and not(starts-with(html:a/@href,'#'))">
                <item href="{html:a[1]/@href}" media-type="application/xhtml+xml">
                  <xsl:attribute name="id">
                    <xsl:text>section</xsl:text>
                    <xsl:number count="html:li" level="any"/>
                  </xsl:attribute>
                </item>
              </xsl:if>
              <xsl:if test="html:ul">
                <xsl:for-each select="html:ul//html:li[not(contains(html:a/@href,'#'))]">
                  <item href="{html:a[1]/@href}" media-type="application/xhtml+xml">
                    <xsl:attribute name="id">
                      <xsl:text>section</xsl:text>
                      <xsl:number count="html:li" level="any"/>
                    </xsl:attribute>
                  </item>
                </xsl:for-each>
              </xsl:if>
            </xsl:for-each>
            <!-- images -->
            <xsl:for-each select="key('GRAPHICS',1)">
              <xsl:variable name="ID">
                <xsl:number level="any"/>
              </xsl:variable>
              <xsl:variable name="mimetype">
                <xsl:choose>
                  <xsl:when test="contains(@url,'.gif')">image/gif</xsl:when>
                  <xsl:when test="contains(@url,'.png')">image/png</xsl:when>
                  <xsl:otherwise>image/jpeg</xsl:otherwise>
                </xsl:choose>
              </xsl:variable>
              <item href="{@url}" id="image-{$ID}" media-type="{$mimetype}"/>
            </xsl:for-each>
            <!-- page images -->
            <xsl:for-each select="key('PAGEIMAGES',1)">
              <xsl:variable name="ID">
                <xsl:text>pb</xsl:text>
                <xsl:number level="any"/>
              </xsl:variable>
              <xsl:variable name="mimetype">
                <xsl:choose>
                  <xsl:when test="contains(@url,'.gif')">image/gif</xsl:when>
                  <xsl:when test="contains(@url,'.png')">image/png</xsl:when>
                  <xsl:otherwise>image/jpeg</xsl:otherwise>
                </xsl:choose>
              </xsl:variable>
              <item href="{@facs}" id="image-{$ID}" media-type="{$mimetype}"/>
            </xsl:for-each>
            <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
          </manifest>
          <spine toc="ncx">
            <itemref idref="titlepage"/>
            <itemref idref="start"/>
            <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
              <xsl:if test="html:a and not(starts-with(html:a/@href,'#'))">
                <itemref>
                  <xsl:attribute name="idref">
                    <xsl:text>section</xsl:text>
                    <xsl:number count="html:li" level="any"/>
                  </xsl:attribute>
                </itemref>
              </xsl:if>
              <xsl:if test="html:ul">
                <xsl:for-each select="html:ul//html:li[not(contains(html:a/@href,'#'))]">
                  <itemref>
                    <xsl:attribute name="idref">
                      <xsl:text>section</xsl:text>
                      <xsl:number count="html:li" level="any"/>
                    </xsl:attribute>
                  </itemref>
                </xsl:for-each>
              </xsl:if>
            </xsl:for-each>
            <itemref idref="titlepageback"/>
          </spine>
          <guide>
            <reference href="titlepage.html" type="cover" title="Cover"/>
            <reference type="text" title="Start" href="index.html"/>
            <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
              <xsl:if test="html:a">
                <reference type="text" href="{html:a[1]/@href}">
                  <xsl:attribute name="title">
                    <xsl:value-of select="normalize-space(html:a[1])"/>
                  </xsl:attribute>
                </reference>
              </xsl:if>
              <!--
		      <xsl:if test="html:ul">
		      <xsl:for-each select="html:ul//html:li[not(contains(html:a/@href,'#'))]">
                      <reference type="text" href="{html:a/@href}">
		      <xsl:attribute name="title">
		      <xsl:value-of select="normalize-space(html:a[1])"/>
		      </xsl:attribute>
                      </reference>
		      </xsl:for-each>
		      </xsl:if>
		  -->
            </xsl:for-each>
            <reference href="titlepageback.html" type="text" title="About this book"/>
          </guide>
        </package>
      </xsl:result-document>
      <xsl:if test="$debug='true'">
        <xsl:message>write file OEBPS/titlepage.html</xsl:message>
      </xsl:if>
      <xsl:result-document href="{concat($directory,'OEBPS/titlepage.html')}" method="xml">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <meta name="calibre:cover" content="true"/>
            <title>Title page</title>
            <style type="text/css" title="override_css">
		@page {padding: 0pt; margin:0pt}
		body { text-align: center; padding:0pt; margin: 0pt; }
	      </style>
          </head>
          <body>
            <xsl:choose>
              <xsl:when test="$coverimage=''">
                <div style="font-family: serif; height:860;          font-size:36pt; border: bold red 1pt; text-align:center">
                  <xsl:call-template name="generateTitle"/>
                </div>
              </xsl:when>
              <xsl:otherwise>
                <div>
                  <img width="600" height="860" alt="cover picture" src="{$coverimage}"/>
                </div>
              </xsl:otherwise>
            </xsl:choose>
          </body>
        </html>
      </xsl:result-document>
      <xsl:if test="$debug='true'">
        <xsl:message>write file OEBPS/titlepageback.html</xsl:message>
      </xsl:if>
      <xsl:result-document href="{concat($directory,'OEBPS/titlepageback.html')}" method="xml">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
          <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>About this book</title>
          </head>
          <body>
            <div style="text-align: left; font-size: smaller">
              <h2>Information about this book</h2>
              <xsl:for-each select="/*/tei:teiHeader/tei:fileDesc">
                <xsl:apply-templates mode="metadata"/>
              </xsl:for-each>
            </div>
          </body>
        </html>
      </xsl:result-document>
      <xsl:if test="$debug='true'">
        <xsl:message>write file OEBPS/toc.ncx</xsl:message>
      </xsl:if>
      <xsl:result-document href="{concat($directory,'OEBPS/toc.ncx')}" method="xml">
        <ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
          <head>
            <meta name="dtb:uid">
              <xsl:attribute name="content">
                <xsl:call-template name="generateID"/>
              </xsl:attribute>
            </meta>
            <meta name="dtb:totalPageCount" content="0"/>
            <meta name="dtb:maxPageNumber" content="0"/>
          </head>
          <docTitle>
            <text>
              <xsl:call-template name="generateSimpleTitle"/>
            </text>
          </docTitle>
          <navMap>
            <xsl:variable name="navPoints">
              <navPoint>
                <navLabel>
                  <text>Title Page and Contents</text>
                </navLabel>
                <content src="index.html"/>
              </navPoint>
              <xsl:for-each select="$TOC/html:TOC/html:ul/html:li">
                <xsl:if test="html:a and not(starts-with(html:a/@href,'#'))">
                  <navPoint>
                    <navLabel>
                      <text>
                        <xsl:value-of select="html:span[@class='headingNumber']"/>
                        <xsl:value-of select="normalize-space(html:a[1])"/>
                      </text>
                    </navLabel>
                    <content src="{html:a/@href}"/>
                  </navPoint>
                </xsl:if>
                <!--		<xsl:if test="html:ul">
                    <xsl:for-each select="html:ul/html:li">
		    <xsl:variable name="pos">
		    <xsl:number level="any"/>
		    </xsl:variable>
		    <navPoint id="navPoint-{$pos+1}" playOrder="{$pos+1}">
		    <navLabel>
		    <text>
		    <xsl:value-of select="normalize-space(html:a[1])"/>
		    </text>
		    </navLabel>
		    <content src="{html:a/@href}"/>
		    </navPoint>
                    </xsl:for-each>
		    </xsl:if>
		-->
              </xsl:for-each>
              <navPoint>
                <navLabel>
                  <text>About this book</text>
                </navLabel>
                <content src="titlepageback.html"/>
              </navPoint>
            </xsl:variable>
            <xsl:for-each select="$navPoints/ncx:navPoint">
              <xsl:variable name="pos" select="position()"/>
              <navPoint id="navPoint-{$pos}" playOrder="{$pos}">
                <xsl:copy-of select="*"/>
              </navPoint>
            </xsl:for-each>
          </navMap>
        </ncx>
      </xsl:result-document>
      <xsl:if test="$debug='true'">
        <xsl:message>write file OEBPS/page-template.xpgt</xsl:message>
      </xsl:if>
      <xsl:result-document method="xml" href="{concat($directory,'OEBPS/page-template.xpgt')}">
        <ade:template xmlns="http://www.w3.org/1999/xhtml" xmlns:ade="http://ns.adobe.com/2006/ade" xmlns:fo="http://www.w3.org/1999/XSL/Format">
          <fo:layout-master-set>
            <fo:simple-page-master master-name="single_column">
              <fo:region-body margin-bottom="3pt" margin-top="0.5em" margin-left="3pt" margin-right="3pt"/>
            </fo:simple-page-master>
            <fo:simple-page-master master-name="single_column_head">
              <fo:region-before extent="8.3em"/>
              <fo:region-body margin-bottom="3pt" margin-top="6em" margin-left="3pt" margin-right="3pt"/>
            </fo:simple-page-master>
            <fo:simple-page-master master-name="two_column" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
              <fo:region-body column-count="2" column-gap="10pt"/>
            </fo:simple-page-master>
            <fo:simple-page-master master-name="two_column_head" margin-bottom="0.5em" margin-left="0.5em" margin-right="0.5em">
              <fo:region-before extent="8.3em"/>
              <fo:region-body column-count="2" margin-top="6em" column-gap="10pt"/>
            </fo:simple-page-master>
            <fo:simple-page-master master-name="three_column" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
              <fo:region-body column-count="3" column-gap="10pt"/>
            </fo:simple-page-master>
            <fo:simple-page-master master-name="three_column_head" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
              <fo:region-before extent="8.3em"/>
              <fo:region-body column-count="3" margin-top="6em" column-gap="10pt"/>
            </fo:simple-page-master>
            <fo:page-sequence-master>
              <fo:repeatable-page-master-alternatives>
                <fo:conditional-page-master-reference master-reference="three_column_head" page-position="first" ade:min-page-width="80em"/>
                <fo:conditional-page-master-reference master-reference="three_column" ade:min-page-width="80em"/>
                <fo:conditional-page-master-reference master-reference="two_column_head" page-position="first" ade:min-page-width="50em"/>
                <fo:conditional-page-master-reference master-reference="two_column" ade:min-page-width="50em"/>
                <fo:conditional-page-master-reference master-reference="single_column_head" page-position="first"/>
                <fo:conditional-page-master-reference master-reference="single_column"/>
              </fo:repeatable-page-master-alternatives>
            </fo:page-sequence-master>
          </fo:layout-master-set>
          <ade:style>
            <ade:styling-rule selector=".title_box" display="adobe-other-region" adobe-region="xsl-region-before"/>
          </ade:style>
        </ade:template>
      </xsl:result-document>
    </xsl:for-each>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template verbatim-lineBreak
Documentation

Description

[epub] Add specific linebreak in verbatim output, as readers do not seem to grok the CSS
Namespace No namespace
Used by
Supersedes
Parameters
QName Namespace
id No namespace
Import precedence 4
Source
<xsl:template name="verbatim-lineBreak">
  <xsl:param name="id"/>
  <br/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template @*|text()|comment()|processing-instruction()fixgraphics
Documentation

Description

[epub] Local mode to rewrite names of graphics inclusions; default is identity transform
Namespace No namespace
Match @*|text()|comment()|processing-instruction()
Mode fixgraphics
Import precedence 4
Source
<xsl:template match="@*|text()|comment()|processing-instruction()" mode="fixgraphics">
  <xsl:copy-of select="."/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template *fixgraphics
Documentation

Description

[epub] Local mode to rewrite names of graphics inclusions; default is identifty transform
Namespace No namespace
Match *
Mode fixgraphics
Import precedence 4
Source
<xsl:template match="*" mode="fixgraphics">
  <xsl:copy>
    <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="fixgraphics"/>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:pb[@facs]|tei:graphicfixgraphics
Documentation

Description

[epub] Local mode to rewrite names of graphics inclusions
Namespace No namespace
Match tei:pb[@facs]|tei:graphic
Mode fixgraphics
Import precedence 4
Source
<xsl:template match="tei:pb[@facs]|tei:graphic" mode="fixgraphics">
  <xsl:copy>
    <xsl:variable name="newName">
      <xsl:text>media/image</xsl:text>
      <xsl:if test="self::tei:pb">pb</xsl:if>
      <xsl:number level="any"/>
      <xsl:text>.</xsl:text>
      <xsl:value-of select="tokenize(@url|@facs,'\.')[last()]"/>
    </xsl:variable>
    <xsl:choose>
      <xsl:when test="self::tei:pb">
        <xsl:attribute name="facs">
          <xsl:value-of select="$newName"/>
        </xsl:attribute>
        <xsl:copy-of select="@n"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:attribute name="url">
          <xsl:value-of select="$newName"/>
        </xsl:attribute>
        <xsl:copy-of select="@n"/>
        <xsl:copy-of select="@height"/>
        <xsl:copy-of select="@width"/>
        <xsl:copy-of select="@scale"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template purgeCSS
Documentation

Description

[epub] Remove unwanted things from CSS
Namespace No namespace
Used by
Template processTEI
Import precedence 4
Source
<xsl:template name="purgeCSS">
  <xsl:choose>
    <xsl:when test="contains(.,'line-height:')"/>
    <xsl:when test="contains(.,'max-width:')"/>
    <xsl:when test="contains(.,'height:')"/>
    <xsl:when test="contains(.,'text-indent:')"/>
    <!--
      <xsl:when test="contains(.,'clear:')"/>
      <xsl:when test="contains(.,'padding')"/>
      <xsl:when test="contains(.,'float:')"/>
      <xsl:when test="contains(.,'font-size:')"/>
      <xsl:when test="contains(.,'width:')"/>
      <xsl:when test="contains(.,'margin')"/>
      <xsl:when test="contains(.,'border')"/>
-->
    <xsl:otherwise>
      <xsl:value-of select="."/>
      <xsl:text>
</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:div/tei:bibl
Namespace No namespace
Match tei:div/tei:bibl
Mode #default
Import precedence 4
Source
<xsl:template match="tei:div/tei:bibl">
  <div class="biblfree">
    <xsl:apply-templates/>
  </div>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:l
Namespace No namespace
Match tei:l
Mode #default
Supersedes
Template tei:l
Import precedence 4
Source
<xsl:template match="tei:l">
  <div class="l">
    <xsl:variable name="n">
      <xsl:number/>
    </xsl:variable>
    <div style="float:left; font-size:smaller; width: 3em;">
      <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/>
  </div>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template addLangAtt
Namespace No namespace
Used by
Supersedes
Template addLangAtt
Import precedence 4
Source
<xsl:template name="addLangAtt"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:pb[@facs]
Namespace No namespace
Match tei:pb[@facs]
Mode #default
Import precedence 4
Source
<xsl:template match="tei:pb[@facs]">
  <xsl:choose>
    <xsl:when test="parent::tei:div | parent::tei:body">
      <div>
        <img src="{@facs}" alt="page image"/>
      </div>
    </xsl:when>
    <xsl:otherwise>
      <img width="600" height="860" src="{@facs}" alt="page image"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:lb[@rend='space']
Namespace No namespace
Match tei:lb[@rend='space']
Mode #default
Import precedence 4
Source
<xsl:template match="tei:lb[@rend='space']">
  <xsl:text> </xsl:text>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:titleStmtmetadata
Namespace No namespace
Match tei:titleStmt
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:titleStmt" mode="metadata">
  <h3>Title</h3>
  <xsl:apply-templates mode="metadata"/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:editionStmtmetadata
Namespace No namespace
Match tei:editionStmt
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:editionStmt" mode="metadata">
  <h3>Edition</h3>
  <xsl:apply-templates mode="metadata"/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:publicationStmtmetadata
Namespace No namespace
Match tei:publicationStmt
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:publicationStmt" mode="metadata">
  <h3>Publication</h3>
  <xsl:choose>
    <xsl:when test="tei:p">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <dl>
        <xsl:apply-templates mode="metadata"/>
      </dl>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:seriesStmtmetadata
Namespace No namespace
Match tei:seriesStmt
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:seriesStmt" mode="metadata">
  <h3>Series</h3>
  <xsl:apply-templates mode="metadata"/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:notesStmtmetadata
Namespace No namespace
Match tei:notesStmt
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:notesStmt" mode="metadata">
  <h3>Notes</h3>
  <xsl:apply-templates mode="metadata"/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:sourceDescmetadata
Namespace No namespace
Match tei:sourceDesc
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:sourceDesc" mode="metadata">
  <h3>Source</h3>
  <xsl:apply-templates mode="metadata"/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:respStmtmetadata
Namespace No namespace
Match tei:respStmt
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:respStmt" mode="metadata">
  <p>
    <i>
      <xsl:value-of select="tei:resp"/>
    </i>:
      <xsl:value-of select="tei:name"/>
  </p>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:extentmetadata
Namespace No namespace
Match tei:extent
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:extent" mode="metadata"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:authoritymetadata
Namespace No namespace
Match tei:authority
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:authority" mode="metadata">
  <dt>Authority</dt>
  <dd>
    <xsl:apply-templates/>
  </dd>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:publicationStmt/tei:addressmetadata
Namespace No namespace
Match tei:publicationStmt/tei:address
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:publicationStmt/tei:address" mode="metadata">
  <dt>Address</dt>
  <dd>
    <xsl:apply-templates/>
  </dd>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:publicationStmt/tei:publishermetadata
Namespace No namespace
Match tei:publicationStmt/tei:publisher
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:publicationStmt/tei:publisher" mode="metadata">
  <dt>Publisher</dt>
  <dd>
    <xsl:apply-templates/>
  </dd>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:distributormetadata
Namespace No namespace
Match tei:distributor
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:distributor" mode="metadata">
  <dt>Distributor</dt>
  <dd>
    <xsl:apply-templates/>
  </dd>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:idnometadata
Namespace No namespace
Match tei:idno
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:idno" mode="metadata">
  <dt>ID [<xsl:value-of select="@type|@iso:meta"/>]</dt>
  <dd>
    <xsl:apply-templates/>
  </dd>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:availability[not(@n) and preceding-sibling::tei:availability/@n]metadata
Namespace No namespace
Match tei:availability[not(@n) and preceding-sibling::tei:availability/@n]
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:availability[not(@n) and preceding-sibling::tei:availability/@n]" mode="metadata"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:availabilitymetadata
Namespace No namespace
Match tei:availability
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:availability" mode="metadata">
  <dt>Availablity</dt>
  <dd>
    <xsl:for-each select="tei:p">
      <xsl:apply-templates/>
    </xsl:for-each>
  </dd>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:datemetadata
Namespace No namespace
Match tei:date
Mode metadata
Import precedence 4
Source
<xsl:template match="tei:date" mode="metadata">
  <dt>Date</dt>
  <dd>
    <xsl:apply-templates/>
  </dd>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template *metadata
Namespace No namespace
Match *
Mode metadata
Import precedence 4
Source
<xsl:template match="*" mode="metadata">
  <p>
    <xsl:apply-templates/>
  </p>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:seriesStmt/tei:p
Namespace No namespace
Match tei:seriesStmt/tei:p
Mode #default
Import precedence 4
Source
<xsl:template match="tei:seriesStmt/tei:p">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:distributor/tei:address
Namespace No namespace
Match tei:distributor/tei:address
Mode #default
Import precedence 4
Source
<xsl:template match="tei:distributor/tei:address">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:authority/tei:address
Namespace No namespace
Match tei:authority/tei:address
Mode #default
Import precedence 4
Source
<xsl:template match="tei:authority/tei:address">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:authority/tei:addLine
Namespace No namespace
Match tei:authority/tei:addLine
Mode #default
Import precedence 4
Source
<xsl:template match="tei:authority/tei:addLine">
  <xsl:apply-templates/>
  <br/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:title[@type='uniform']
Namespace No namespace
Match tei:title[@type='uniform']
Mode #default
Import precedence 4
Source
<xsl:template match="tei:title[@type='uniform']"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:editionStmt/tei:p
Namespace No namespace
Match tei:editionStmt/tei:p
Mode #default
Import precedence 4
Source
<xsl:template match="tei:editionStmt/tei:p">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:editor
Namespace No namespace
Match tei:editor
Mode #default
Import precedence 4
Source
<xsl:template match="tei:editor">
  <xsl:apply-templates/>
  <xsl:text> (editor)</xsl:text>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:title[@type='main']
Namespace No namespace
Match tei:title[@type='main']
Mode #default
Import precedence 4
Source
<xsl:template match="tei:title[@type='main']">
  <i>
    <xsl:apply-templates/>
  </i>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Template tei:title[@type='alternative']
Namespace No namespace
Match tei:title[@type='alternative']
Mode #default
Import precedence 4
Source
<xsl:template match="tei:title[@type='alternative']">
  <xsl:apply-templates/>
  <xsl:text> (alternative title)</xsl:text>
</xsl:template>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter doctypePublic
Namespace No namespace
Used by
Supersedes
Parameter doctypePublic
Source
<xsl:param name="doctypePublic">-//W3C//DTD XHTML 1.1//EN</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter doctypeSystem
Namespace No namespace
Used by
Supersedes
Parameter doctypeSystem
Source
<xsl:param name="doctypeSystem">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter directory
Namespace No namespace
Used by
Template processTEI
Source
<xsl:param name="directory"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter splitLevel
Namespace No namespace
Used by
Supersedes
Parameter splitLevel
Source
<xsl:param name="splitLevel">0</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter STDOUT
Namespace No namespace
Used by
Supersedes
Parameter STDOUT
Source
<xsl:param name="STDOUT">false</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter outputDir
Namespace No namespace
Used by
Template outputChunkName
Supersedes
Parameter outputDir
Source
<xsl:param name="outputDir">OEBPS</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter cssFile
Namespace No namespace
Used by
Supersedes
Parameter cssFile
Source
<xsl:param name="cssFile">../tei.css</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter cssPrintFile
Namespace No namespace
Used by
Supersedes
Parameter cssPrintFile
Source
<xsl:param name="cssPrintFile">../tei-print.css</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter cssODDFile
Namespace No namespace
Used by
Template processTEI
Source
<xsl:param name="cssODDFile">../odd.css</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter topNavigationPanel
Namespace No namespace
Used by
Supersedes
Parameter topNavigationPanel
Source
<xsl:param name="topNavigationPanel">false</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter bottomNavigationPanel
Namespace No namespace
Used by
Supersedes
Source
<xsl:param name="bottomNavigationPanel">false</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter autoToc
Namespace No namespace
Used by
Supersedes
Parameter autoToc
Source
<xsl:param name="autoToc">true</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter autoHead
Namespace No namespace
Used by
Supersedes
Parameter autoHead
Source
<xsl:param name="autoHead">true</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter tocDepth
Namespace No namespace
Used by
Template tei:*maketoc
Supersedes
Parameter tocDepth
Source
<xsl:param name="tocDepth">1</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter linkPanel
Namespace No namespace
Used by
Supersedes
Parameter linkPanel
Source
<xsl:param name="linkPanel">false</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter institution
Namespace No namespace
Used by
Template stdheader
Supersedes
Parameter institution
Source
<xsl:param name="institution"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter subject
Namespace No namespace
Used by
Template generateSubject
Source
<xsl:param name="subject"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter uid
Namespace No namespace
Used by
Template generateID
Source
<xsl:param name="uid"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter publisher
Namespace No namespace
Used by
Source
<xsl:param name="publisher"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter coverimage
Namespace No namespace
Used by
Template processTEI
Source
<xsl:param name="coverimage"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter odd
Namespace No namespace
Used by
Template processTEI
Source
<xsl:param name="odd">false</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Parameter debug
Namespace No namespace
Used by
Template processTEI
Source
<xsl:param name="debug">false</xsl:param>
Stylesheet location ../../../epub/tei-to-epub.xsl
Output (default)
Namespace No namespace
Output properties
method encoding indent
xml yes
Source
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Key GRAPHICS
Namespace No namespace
Match tei:graphic
Use 1
Used by
Template processTEI
Source
<xsl:key name="GRAPHICS" use="1" match="tei:graphic"/>
Stylesheet location ../../../epub/tei-to-epub.xsl
Key PAGEIMAGES
Namespace No namespace
Match tei:pb[@facs]
Use 1
Used by
Template processTEI
Source
<xsl:key name="PAGEIMAGES" use="1" match="tei:pb[@facs]"/>
Stylesheet location ../../../epub/tei-to-epub.xsl