Showing:

Documentation
Used by
References
Included from
Source
Stylesheet tei-makecolspec.xsl
Documentation

Description

TEI stylesheet for making table specifications, making XSL-FO output.

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-makecolspec.xsl 7025 2009-11-29 19:47:02Z rahtz $

Copyright: 2008, TEI Consortium

Included from
Stylesheet version 2.0
Template calculateTableSpecs
Documentation

Description

[fo]
Namespace No namespace
Used by
Template deriveColSpecs
References
Parameter foEngine
Import precedence 3
Source
<xsl:template name="calculateTableSpecs">
  <xsl:variable name="tds">
    <xsl:for-each select=".//tei:cell">
      <xsl:variable name="stuff">
        <xsl:apply-templates/>
      </xsl:variable>
      <cell>
        <xsl:attribute name="col">
          <xsl:number/>
        </xsl:attribute>
        <xsl:value-of select="string-length($stuff)"/>
      </cell>
    </xsl:for-each>
  </xsl:variable>
  <xsl:variable name="total">
    <xsl:value-of select="sum($tds/cell)"/>
  </xsl:variable>
  <xsl:for-each select="$tds/cell">
    <xsl:sort select="@col" data-type="number"/>
    <xsl:variable name="c" select="@col"/>
    <xsl:if test="not(preceding-sibling::cell[$c=@col])">
      <xsl:variable name="len">
        <xsl:value-of select="sum(following-sibling::cell[$c=@col]) + current()"/>
      </xsl:variable>
      <xsl:text>
</xsl:text>
      <table-column column-number="{@col}" column-width="{$len div $total * 100}%">
        <xsl:if test="$foEngine='passivetex'">
          <xsl:attribute name="column-align" namespace="http://www.tug.org/fotex">L</xsl:attribute>
        </xsl:if>
      </table-column>
    </xsl:if>
  </xsl:for-each>
  <xsl:text>
</xsl:text>
</xsl:template>
Stylesheet location ../../../fo2/tei-makecolspec.xsl
Template deriveColSpecs
Documentation

Description

[fo]
Namespace No namespace
Used by
Template blockTable
References
Import precedence 3
Source
<xsl:template name="deriveColSpecs">
  <xsl:variable name="no">
    <xsl:call-template name="generateTableID"/>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="$readColSpecFile">
      <xsl:variable name="specs">
        <xsl:value-of select="count($tableSpecs/Info/TableSpec[$no=@xml:id])"/>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="$specs > 0">
          <xsl:for-each select="$tableSpecs/Info/TableSpec[$no=@xml:id]/table-column">
            <xsl:copy-of select="."/>
          </xsl:for-each>
        </xsl:when>
        <xsl:otherwise>
          <!--
 <xsl:message>Build specs for Table <xsl:value-of select="$no"/></xsl:message>
-->
          <xsl:call-template name="calculateTableSpecs"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:when>
    <xsl:otherwise>
      <!--
 <xsl:message>Build specs for Table <xsl:value-of select="$no"/></xsl:message>
-->
      <xsl:call-template name="calculateTableSpecs"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/tei-makecolspec.xsl
Template generateTableID
Documentation

Description

[fo]
Namespace No namespace
Used by
Template deriveColSpecs
Import precedence 3
Source
<xsl:template name="generateTableID">
  <xsl:choose>
    <xsl:when test="@xml:id">
      <xsl:value-of select="@xml:id"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>Table-</xsl:text>
      <xsl:number level="any"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/tei-makecolspec.xsl