tgroup

- SourceForge
- Home Page
- Samples

- Reference Contents |
- Download & Install |
- User Guides |
- Notes, E-mail & Bugs |
- Q&A

Suggestions
Search:
Next: colspec
Previous: generate.starfactor Up: Tables table.mod.xsl

Reference Section

## Name

tgroup — Process `tgroup` [2.0.9] elements

## Synopsis

    <xsl:template match="tgroup">
    <xsl:variable name="colsep">
    			<xsl:choose>
    				<xsl:when test="@colsep!=''">
    					<xsl:value-of select="number(@colsep)"/>
    				</xsl:when>
    				<xsl:when test="../@colsep!=''">
    					<xsl:value-of select="number(../@colsep)"/>
    				</xsl:when>
    				<xsl:otherwise>1</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
    <xsl:variable name="frame">
    			<xsl:choose>
    				<xsl:when test="string-length(../@frame)<1">all</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="../@frame"/>
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
    <xsl:variable name="colspecs" select="./colspec"/>
    <xsl:variable name="usex">
    			<xsl:choose>
    				<xsl:when test="$latex.use.ltxtable='1'">
    					<xsl:text>0</xsl:text>
    				</xsl:when>
    				<!-- if there are lists within cells, we need tabularx -->
    				<xsl:when test="$latex.use.tabularx=1 and (descendant::itemizedlist|descendant::orderedlist|descendant::variablelist)">
    					<xsl:text>1</xsl:text>
    				</xsl:when>
    				<!-- if there are instances of 1*-style colwidths, we need tabularx -->
    				<xsl:when test="$latex.use.tabularx=1 and contains(colspec/@colwidth,'*')">
    					<xsl:text>1</xsl:text>
    				</xsl:when>
    				<!-- if there are colspecs with 'justify' alignment and no explicit width, we need tabularx -->
    				<xsl:when test="$latex.use.tabularx=1 and count(colspec[@align='justify'])>0">
    					<xsl:text>1</xsl:text>
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:text>0</xsl:text>
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
    <xsl:variable name="useminipage">
    			<!-- Hack to get around LaTeX issue with tabular (not necessary with tabularx).
    			This is NOT a good solution, and has problems of its own, but at least the footnotes
    			do not actually disappear (which is what would otherwise happen). -->
    			<xsl:if test="count(.//footnote)!=0">1</xsl:if>
    		</xsl:variable>
    <xsl:variable name="cols">
    			<xsl:choose>
    				<xsl:when test="@cols">
    					<xsl:value-of select="@cols"/>
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="count(tbody/row[1]/entry)"/>
    					<xsl:message>Warning: table's tgroup lacks cols attribute. Assuming <xsl:value-of select="count(tbody/row[1]/entry)"/>.</xsl:message>
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
    <xsl:variable name="thead.frame">
    			<xsl:choose>
    				<xsl:when test="$frame!='sides' and $frame!='none' and $frame!='bottom'">
    					<xsl:value-of select="1"/>
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="0"/>
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
    <xsl:variable name="tfoot.frame">
    			<xsl:choose>
    				<xsl:when test="$frame!='sides' and $frame!='none' and $frame!='top'">
    					<xsl:value-of select="1"/>
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="0"/>
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
      ...
    </xsl:template>

## B. Pertinent Variables

There are no configuration variables for this template.

Prev | Up | Next
generate.starfactor | Home | colspec