TEI stylesheet
customization module for
fo 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
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.
[fo] the content of a list item. item behaviour depends on the type attribute of our
parent:
simple, bullets, ordered, gloss, unordered, or bibliography
<xsl:template name="makeItem"><list-item><xsl:variable name="listdepth" select="count(ancestor::tei:list)"/><xsl:if test="not(parent::tei:note[tei:isEndNote(.) or tei:isFootNote(.)])"><xsl:attribute name="space-before.optimum"><xsl:value-of select="$listItemsep"/></xsl:attribute></xsl:if><list-item-label end-indent="label-end()"><xsl:if test="@xml:id"><xsl:attribute name="id"><xsl:value-of select="@xml:id"/></xsl:attribute></xsl:if><xsl:text></xsl:text><block><xsl:choose><xsl:when test="@n"><xsl:attribute name="text-align">end</xsl:attribute><xsl:value-of select="@n"/></xsl:when><xsl:when test="../@type='bibliography'"><xsl:attribute name="text-align">end</xsl:attribute><xsl:apply-templates mode="xref" select="."/></xsl:when><xsl:when test="tei:isOrderedList(..) or self::tei:bibl"><xsl:attribute name="text-align">end</xsl:attribute><xsl:apply-templates mode="xref" select="."/><xsl:text>.</xsl:text></xsl:when><xsl:when test="tei:isGlossList(..)"><xsl:attribute name="text-align">start</xsl:attribute><xsl:attribute name="font-weight">bold</xsl:attribute><!-- We don't want hyphenated terms or attributes wrapping to the next line. --><xsl:attribute name="keep-together.within-line" select="'always'"/><xsl:choose><xsl:when test="tei:label"><xsl:apply-templates mode="print" select="tei:label"/></xsl:when><xsl:otherwise><xsl:apply-templates mode="print" select="preceding-sibling::tei:*[1]"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="tei:isOrderedList(..) or self::tei:biblStruct or self::tei:bibl"><xsl:attribute name="text-align">end</xsl:attribute><xsl:number/><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:attribute name="text-align">end</xsl:attribute><xsl:choose><xsl:when test="$listdepth=0"><xsl:value-of select="$bulletOne"/></xsl:when><xsl:when test="$listdepth=1"><xsl:value-of select="$bulletOne"/></xsl:when><xsl:when test="$listdepth=2"><xsl:value-of select="$bulletTwo"/></xsl:when><xsl:when test="$listdepth=3"><xsl:value-of select="$bulletThree"/></xsl:when><xsl:when test="$listdepth=4"><xsl:value-of select="$bulletFour"/></xsl:when></xsl:choose></xsl:otherwise></xsl:choose></block></list-item-label><list-item-body start-indent="body-start()"><xsl:choose><xsl:when test="* and tei:list"><xsl:for-each select="*"><xsl:choose><xsl:when test="self::tei:list"><xsl:apply-templates select="."/></xsl:when><xsl:otherwise><block font-weight="normal"><xsl:apply-templates/></block></xsl:otherwise></xsl:choose></xsl:for-each></xsl:when><xsl:otherwise><block font-weight="normal"><!-- If we're processing a valList, then we're already nested three tables
deep and the normal label/item spacing is inadequate to keep the item
from overwriting the label. The simplest thing is to add a return. --><xsl:if test="@rend='odd_value' or ancestor::tei:list[1][@type='gloss']"><block></block></xsl:if><xsl:apply-templates/></block></xsl:otherwise></xsl:choose></list-item-body></list-item></xsl:template>
This is used to tailor the result for different XSL FO processors.
By default, no special measures are taken, so
there are no bookmarks or other such features. Possible values are
passivetex (the TeX-based PassiveTeX processor)
xep (XEP)
fop (FOP)
antenna (Antenna House)
TOC leader pattern, options are:
- rule A rule. If this choice is selected, the "rule-thickness" and "rule-style" properties
are used to set the leader's style.
- dots A repeating sequence of dots. The choice of dot character is dependent on the
user agent.
- use-content A repeating pattern as specified by $tocLeaderPatternContent.
inherit
TOC rule style as specified by FO:
none No rule, forces rule-thickness to 0.
dotted A series of dots.
dashed A series of short line segments.
solid A single line segment.
double Two solid lines. The sum of the two lines and the space between them equals
the value of "rule-thickness".
groove The rule looks as though it were carved into the canvas. (Top/left half of
the rule's thickness is the color specified; the other half is white.)
ridge The opposite of "groove", the rule looks as though it were coming out of the
canvas. (Bottom/right half of the rule's thickness is the color specified; the other
half is white.)
inherit