Mode:

Compact lists

Showing:

Documentation
References
Imported from
Source
Stylesheet epub-preflight.xsl
Documentation

Description

TEI stylesheet for making ePub output, preflight pass to clean up text.

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: epub-preflight.xsl 12078 2013-05-05 12:51:58Z rahtz $

Copyright: 2013, TEI Consortium

Imported from
Stylesheet version 2.0
Template @*|text()|comment()|processing-instruction()preflight
Documentation

Description

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

Description

[epub] Local mode to rewrite names of graphics inclusions; default is identifty transform
Namespace No namespace
Match *
Mode preflight
Import precedence 15
Source
<xsl:template match="*" mode="preflight">
  <xsl:copy>
    <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="preflight"/>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../epub/epub-preflight.xsl
Template tei:graphicpreflight
Namespace No namespace
Match tei:graphic
Mode preflight
References
Parameter
Import precedence 15
Source
<xsl:template match="tei:graphic" mode="preflight">
  <xsl:copy>
    <xsl:choose>
      <xsl:when test="$fixgraphicsurl='true'">
        <xsl:variable name="newName">
          <xsl:text>media/resource</xsl:text>
          <xsl:number level="any"/>
          <xsl:text>.</xsl:text>
          <xsl:value-of select="tokenize(@url,'\.')[last()]"/>
        </xsl:variable>
        <xsl:attribute name="url">
          <xsl:value-of select="$newName"/>
        </xsl:attribute>
        <xsl:copy-of select="@*[not(local-name()='url')]"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="@*"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../epub/epub-preflight.xsl
Template tei:pb[@facs]preflight
Namespace No namespace
Match tei:pb[@facs]
Mode preflight
References
Parameter
Import precedence 15
Source
<xsl:template match="tei:pb[@facs]" mode="preflight">
  <xsl:copy>
    <xsl:choose>
      <xsl:when test="@rend='none'">
        <xsl:copy-of select="@*"/>
      </xsl:when>
      <xsl:when test="$fixgraphicsurl='true'">
        <xsl:variable name="newName">
          <xsl:text>media/pageimage</xsl:text>
          <xsl:number level="any"/>
          <xsl:text>.</xsl:text>
          <xsl:value-of select="tokenize(@facs,'\.')[last()]"/>
        </xsl:variable>
        <xsl:attribute name="facs">
          <xsl:value-of select="$newName"/>
        </xsl:attribute>
        <xsl:copy-of select="@*[not(local-name()='facs')]"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="@*"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:copy>
</xsl:template>
Stylesheet location ../../../epub/epub-preflight.xsl
Template tei:hi[tei:pb]preflight
Namespace No namespace
Match tei:hi[tei:pb]
Mode preflight
Import precedence 15
Source
<xsl:template match="tei:hi[tei:pb]" mode="preflight">
  <xsl:variable name="atts" select="@*"/>
  <xsl:for-each-group select="node()" group-starting-with="tei:pb|tei:figure">
    <xsl:choose>
      <xsl:when test="self::tei:pb">
        <xsl:apply-templates select="." mode="preflight"/>
        <tei:hi>
          <xsl:copy-of select="$atts"/>
          <xsl:copy-of select="current-group() except ."/>
        </tei:hi>
      </xsl:when>
      <xsl:when test="self::tei:figure">
        <xsl:copy-of select="."/>
        <tei:hi>
          <xsl:copy-of select="$atts"/>
          <xsl:copy-of select="current-group() except ."/>
        </tei:hi>
      </xsl:when>
      <xsl:otherwise>
        <tei:hi>
          <xsl:copy-of select="$atts"/>
          <xsl:copy-of select="current-group()"/>
        </tei:hi>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each-group>
</xsl:template>
Stylesheet location ../../../epub/epub-preflight.xsl