Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / fo2 / teiCustom.xsl @ 187

History | View | Annotate | Download (2.6 kB)

1 187 sjacqu01
<?xml version="1.0" encoding="utf-8"?>
2 187 sjacqu01
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 187 sjacqu01
                xmlns:fotex="http://www.tug.org/fotex"
4 187 sjacqu01
                xmlns="http://www.w3.org/1999/XSL/Format"
5 187 sjacqu01
                xmlns:tei="http://www.tei-c.org/ns/1.0"
6 187 sjacqu01
                version="1.0">
7 187 sjacqu01
    <xsl:import href="tei.xsl"/>
8 187 sjacqu01
9 187 sjacqu01
    <!-- oXygen begin change -->
10 187 sjacqu01
    <!--
11 187 sjacqu01
        The default value of the 'tableAlign' param set in common/ tei-param.xsl is
12 187 sjacqu01
        'leftTable' which is not a standard XSL-FO value for this param. It is reported
13 187 sjacqu01
        as error by both Apache FOP and XEP. We set the default value to a
14 187 sjacqu01
        standard one.
15 187 sjacqu01
    -->
16 187 sjacqu01
    <xsl:param name="tableAlign">left</xsl:param>
17 187 sjacqu01
    <!-- oXygen end change -->
18 187 sjacqu01
19 187 sjacqu01
    <xsl:template match="tei:table">
20 187 sjacqu01
        <xsl:choose>
21 187 sjacqu01
            <xsl:when test="@rend='eqnarray' and $foEngine='passivetex'">
22 187 sjacqu01
                <fotex:eqnarray>
23 187 sjacqu01
                    <xsl:apply-templates select=".//tei:formula"/>
24 187 sjacqu01
                </fotex:eqnarray>
25 187 sjacqu01
            </xsl:when>
26 187 sjacqu01
            <xsl:when test=".//tei:formula[@type='subeqn'] and $foEngine='passivetex'">
27 187 sjacqu01
                <fotex:eqnarray>
28 187 sjacqu01
                    <xsl:apply-templates select=".//tei:formula"/>
29 187 sjacqu01
                </fotex:eqnarray>
30 187 sjacqu01
            </xsl:when>
31 187 sjacqu01
            <xsl:when test="$inlineTables or @rend='inline'">
32 187 sjacqu01
                <xsl:if test="tei:head">
33 187 sjacqu01
                    <block>
34 187 sjacqu01
                        <xsl:call-template name="tableCaptionstyle"/>
35 187 sjacqu01
                        <!-- oXygen begin change -->
36 187 sjacqu01
                        <!--
37 187 sjacqu01
                            The same ID attribute value generated from the same node of the XML
38 187 sjacqu01
                            source cannot be added to two different elements of the XSL-FO result,
39 187 sjacqu01
                            that is an fo:block and a child element fo:table. Here we skip adding the ID
40 187 sjacqu01
                            attribute for the child element.
41 187 sjacqu01
                        -->
42 187 sjacqu01
                        <!-- <xsl:call-template name="addID"/> -->
43 187 sjacqu01
                        <!-- oXygen end change -->
44 187 sjacqu01
                        <xsl:if test="$makeTableCaption='true'">
45 187 sjacqu01
                            <xsl:call-template name="calculateTableNumber"/>
46 187 sjacqu01
                            <xsl:text>. </xsl:text>
47 187 sjacqu01
                        </xsl:if>
48 187 sjacqu01
                        <xsl:apply-templates select="tei:head"/>
49 187 sjacqu01
                    </block>
50 187 sjacqu01
                </xsl:if>
51 187 sjacqu01
                <xsl:call-template name="blockTable"/>
52 187 sjacqu01
            </xsl:when>
53 187 sjacqu01
            <xsl:otherwise>
54 187 sjacqu01
                <xsl:call-template name="floatTable"/>
55 187 sjacqu01
            </xsl:otherwise>
56 187 sjacqu01
        </xsl:choose>
57 187 sjacqu01
    </xsl:template>
58 187 sjacqu01
</xsl:stylesheet>