Project

Profile

Help

Bug #3507 ยป tables.xsl

Radu Coravu, 2017-10-31 15:35

 
<?xml version='1.0' encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:exsl="http://exslt.org/common" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
xmlns:xs="http://www.w3.org/2001/XMLSchema" extension-element-prefixes="exsl" version="2.0">

<xsl:param name="tableSpecNonProportional" select="'true'"/>

<!-- STANDARD TABLE -->
<xsl:template match="*[contains(@class, ' topic/table ')]">

<xsl:variable name="scale">
<xsl:choose>
<xsl:when test="@scale">
<xsl:value-of select="@scale"/>
</xsl:when>
<xsl:otherwise>100</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="tgroup_count" select="count(*[contains(@class, ' topic/tgroup ')])"/>

<xsl:variable name="yes_string">yes</xsl:variable>

<xsl:variable name="test1"
select="
*[contains(@class, ' topic/tgroup ')][1]/
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')][1]"/>

<xsl:variable name="test1a"
select="
ancestor::*[contains(@class, ' topic/tgroup ')]/
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')][1]"/>

<xsl:variable name="test2"
select="
*[contains(@class, ' topic/tgroup ')][2]/
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')][1]"/>

<xsl:variable name="test3">
<xsl:choose>
<xsl:when test="$test1 = 'TL1'">TL1</xsl:when>
<xsl:when test="contains($test1, 'TL1 (Defaults in Bold)')">TL1</xsl:when>
</xsl:choose>
</xsl:variable>

<xsl:variable name="test4">
<xsl:if test="$test2 = 'NETSMART 500'">N500</xsl:if>
</xsl:variable>

<xsl:variable name="test5">
<xsl:choose>
<xsl:when test="$test3 = 'TL1' and $test4 = 'N500'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="test6">
<xsl:choose>
<xsl:when test="$test1a = 'NETSMART 500'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="test7">
<xsl:choose>
<xsl:when test="$test1 = 'CLI'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="test8">
<xsl:choose>
<xsl:when
test="$test3 = 'TL1' and *[contains(@class, ' topic/tgroup ')][1]//*[contains(@class, ' topic/table ')]"
>yes</xsl:when>
<xsl:when test="$test3 = 'TL1' and *[contains(@class, ' topic/tgroup ')][1]//*[contains(@class, ' topic/dl ')]"
>yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="test9">
<xsl:choose>
<xsl:when test="$test1 = 'Terminal Emulator'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="test10">
<xsl:choose>
<xsl:when test="$test1 = 'FLEXR GT'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>


<xsl:variable name="table_scale">
<xsl:variable name="font_num" select="substring-before($default-font-size-fujitsu-table, 'pt')"/>
<xsl:variable name="new_font_num" select="number($font_num) * $scale div 100"/>
<xsl:variable name="font_string" select="string($new_font_num)"/>
<xsl:value-of select="concat($font_string, 'pt')"/>
</xsl:variable>

<xsl:if test="*[contains(@class, ' topic/title ')][ancestor::dd] and preceding-sibling::*">
<fo:block space-before="9pt"/>
</xsl:if>

<xsl:apply-templates select="*[contains(@class, ' topic/desc ')]/*"/>

<xsl:choose>
<xsl:when test="@outputclass = 'screen'">
<fo:block xsl:use-attribute-sets="table__screen">
<xsl:call-template name="rev_bar"/>
<xsl:apply-templates>
<xsl:with-param name="table_scale" select="$table_scale" tunnel="yes"/>
</xsl:apply-templates>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="table">
<xsl:copy-of select="@id"/>
<xsl:if test="*[contains(@class, ' topic/title ')][ancestor::dd]">
<xsl:attribute name="space-before">0pt</xsl:attribute>
</xsl:if>
<xsl:if test="*[contains(@class, ' topic/title ')][not(ancestor::dd)]">
<xsl:attribute name="space-before">24pt</xsl:attribute>
</xsl:if>
<xsl:if test="ancestor::table and *[contains(@class, ' topic/title ')]">
<xsl:attribute name="space-before">0pt</xsl:attribute>
</xsl:if>
<xsl:if test="$test5 = $yes_string and $test8 = 'no'">
<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
</xsl:if>
<xsl:if test="$test6 = $yes_string">
<xsl:attribute name="padding-bottom">6pt</xsl:attribute>
</xsl:if>
<xsl:if test="$test7 = $yes_string">
<xsl:attribute name="padding-bottom">6pt</xsl:attribute>
</xsl:if>
<xsl:if test="$test9 = $yes_string">
<xsl:attribute name="padding-bottom">6pt</xsl:attribute>
</xsl:if>
<xsl:if test="$test10 = $yes_string">
<xsl:attribute name="padding-bottom">6pt</xsl:attribute>
</xsl:if>
<xsl:call-template name="rev_bar"/>

<xsl:choose>
<xsl:when test="@outputclass = 'parallel'">
<xsl:apply-templates select="title"/>
<fo:block-container>
<xsl:attribute name="axf:column-count">
<xsl:value-of select="$tgroup_count"/>
</xsl:attribute>
<xsl:apply-templates select="*[local-name() != 'title']">
<xsl:with-param name="table_scale" select="$table_scale" tunnel="yes"/>
</xsl:apply-templates>
</fo:block-container>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates>
<xsl:with-param name="table_scale" select="$table_scale" tunnel="yes"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:otherwise>
</xsl:choose>


<xsl:if test="descendant::*[contains(@class, ' topic/fn ')]">
<xsl:for-each select="descendant::*[contains(@class, ' topic/fn ')]">
<fo:block keep-with-previous="always">
<fo:list-block>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block text-align="right" color="blue" font-size="8pt">
<fo:inline>
<xsl:number level="any" count="*[contains(@class, ' topic/fn ')]"
from="//*[contains(@class, ' topic/table ')]"/>
</fo:inline>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block color="navy" font-size="9pt">
<xsl:if test="lines | codeblock">
<xsl:attribute name="padding-top">6pt</xsl:attribute>
<xsl:attribute name="padding-bottom">6pt</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</fo:block>
</xsl:for-each>
</xsl:if>
</xsl:template>


<!-- TABLE TITLE -->

<xsl:template
match="*[contains(@class, ' topic/table ')][not(@outputclass = 'parallel')]/*[contains(@class, ' topic/title ')]"/>

<!-- TABLE DESCRIPTION -->

<xsl:template match="*[contains(@class, ' topic/table ')]/*[contains(@class, ' topic/desc ')]"> </xsl:template>

<!-- TITLE FOR TABLE WITHIN TABLE -->
<xsl:template
match="*[contains(@class, ' topic/table ')]/*//*[contains(@class, ' topic/table ')]/*[contains(@class, ' topic/title ')]">
<fo:block xsl:use-attribute-sets="sub__table__title">
<xsl:value-of select="text()"/>
</fo:block>
</xsl:template>

<xsl:template match="*[contains(@class, ' topic/tgroup ')]" name="tgroup">

<!-- BEGIN TGROUP VARIABLES -->
<xsl:variable name="yes_string">yes</xsl:variable>

<xsl:variable name="general_subtable_test">
<xsl:choose>
<xsl:when test="parent::*[contains(@class, ' topic/table ')]/ancestor::*[contains(@class, ' topic/table ')]"
>yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="test_single_column">
<xsl:choose>
<xsl:when
test="
*[contains(@class, ' topic/tbody ')]/
*[contains(@class, ' topic/row ')]/
*[contains(@class, ' topic/entry ')][2]"
>no</xsl:when>
<xsl:otherwise>yes</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="top_left_structure"
select="
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')][1]"/>

<xsl:variable name="parent_top_left_structure"
select="
parent::*[contains(@class, ' topic/table ')]/
ancestor::*[contains(@class, ' topic/tgroup ')]/
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')][1]"/>


<xsl:variable name="tl1_ns_test">
<xsl:choose>
<xsl:when test="$top_left_structure = 'TL1'">yes</xsl:when>
<xsl:when test="$top_left_structure = 'NETSMART 500'">yes</xsl:when>
<xsl:when test="$top_left_structure = 'NETSMART 1500'">yes</xsl:when>
<xsl:when test="$top_left_structure = 'FLEXR GT'">yes</xsl:when>
<xsl:when test="$top_left_structure = 'CLI'">yes</xsl:when>
<xsl:when test="$top_left_structure = 'Terminal Emulator'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="ns_sub_test">
<xsl:choose>
<xsl:when test="$parent_top_left_structure = 'NETSMART 500'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="tl1_sub_test">
<xsl:choose>
<xsl:when test="$parent_top_left_structure = 'TL1'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:if test="not(@cols)">
<xsl:message terminate="yes">
<xsl:text>ERROR: Number of columns must be specified.</xsl:text>
</xsl:message>
</xsl:if>

<xsl:variable name="table">

<xsl:choose>
<xsl:when test="parent::table/@outputclass = 'screen'">
<fo:table xsl:use-attribute-sets="table__screen__2">
<xsl:call-template name="displayAtts_screen">
<xsl:with-param name="element" select=".."/>
</xsl:call-template>
<xsl:apply-templates/>
</fo:table>
</xsl:when>

<xsl:when test="$tl1_ns_test = $yes_string">
<fo:table xsl:use-attribute-sets="table.tgroup">
<xsl:call-template name="displayAtts_TL1_NS">
<xsl:with-param name="element" select=".."/>
</xsl:call-template>

<xsl:apply-templates/>
</fo:table>
</xsl:when>

<xsl:when test="$ns_sub_test = $yes_string">
<fo:table xsl:use-attribute-sets="table.tgroup">
<xsl:call-template name="displayAtts_NS_sub">
<xsl:with-param name="element" select=".."/>
</xsl:call-template>

<xsl:apply-templates/>
</fo:table>
</xsl:when>

<xsl:when test="$tl1_sub_test = $yes_string">
<fo:table xsl:use-attribute-sets="table.tgroup">
<xsl:call-template name="displayAtts_TL1_sub">
<xsl:with-param name="element" select=".."/>
</xsl:call-template>

<xsl:apply-templates/>
</fo:table>
</xsl:when>

<xsl:when test="$general_subtable_test = $yes_string">
<fo:table xsl:use-attribute-sets="table.tgroup">
<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
<xsl:call-template name="displayAtts">
<xsl:with-param name="element" select=".."/>
</xsl:call-template>

<xsl:apply-templates/>
</fo:table>
</xsl:when>

<xsl:otherwise>
<fo:table xsl:use-attribute-sets="table.tgroup">
<xsl:call-template name="displayAtts">
<xsl:with-param name="element" select=".."/>
</xsl:call-template>

<xsl:apply-templates/>
</fo:table>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- END TGROUP VARIABLES-->

<xsl:copy-of select="$table"/>

</xsl:template>

<xsl:template match="*[contains(@class, ' topic/thead ')]">

<xsl:variable name="fec"
select="
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1]
[not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')][1]"/>
<xsl:variable name="first_tgroup_test">
<xsl:choose>
<xsl:when
test="parent::*[contains(@class, ' topic/tgroup ')]/preceding-sibling::*[contains(@class, ' topic/tgroup ')]"
>no</xsl:when>
<xsl:otherwise>yes</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="parallel_test">
<xsl:choose>
<xsl:when
test="parent::*[contains(@class, ' topic/tgroup ')]/parent::*[contains(@class, ' topic/table ')][@outputclass = 'parallel']"
>yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="table_title"
select="parent::*[contains(@class, ' topic/tgroup ')]/preceding-sibling::*[contains(@class, ' topic/title ')]"/>
<xsl:variable name="table_title_id"
select="parent::*[contains(@class, ' topic/tgroup ')]/preceding-sibling::*[contains(@class, ' topic/title ')]/@id"/>

<xsl:variable name="column-count" as="xs:integer">
<xsl:value-of select="count(parent::*[contains(@class, ' topic/tgroup ')]/*[contains(@class, ' topic/colspec ')])"
/>
</xsl:variable>

<xsl:choose>
<xsl:when test="$fec = 'TL1'">
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block line-height="0pt" margin-left="-17px">
<xsl:call-template name="tl1_tab"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
</xsl:when>
<xsl:when test="$fec = 'CLI'">
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block line-height="0pt" margin-left="-17px">
<xsl:call-template name="cli_tab"/>
</fo:block>
<fo:block xsl:use-attribute-sets="thead.row.entry.sw.cont__content" background-color="{$cli_color}">
<fo:retrieve-table-marker retrieve-class-name="continued-text-sw-tbl"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
</xsl:when>
<xsl:when test="$fec = 'Terminal Emulator'">
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block line-height="0pt" margin-left="-17px">
<xsl:call-template name="termemul_tab"/>
</fo:block>
<fo:block xsl:use-attribute-sets="thead.row.entry.sw.cont__content" background-color="{$termemul_color}">
<fo:retrieve-table-marker retrieve-class-name="continued-text-sw-tbl"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
</xsl:when>
<xsl:when test="$fec = 'FLEXR GT'">
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block line-height="0pt" margin-left="-17px">
<xsl:call-template name="flxgt_tab"/>
</fo:block>
<fo:block xsl:use-attribute-sets="thead.row.entry.sw.cont__content" background-color="{$flxgt_color}">
<fo:retrieve-table-marker retrieve-class-name="continued-text-sw-tbl"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
</xsl:when>
<xsl:when test="$fec = 'NETSMART 500'">
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block line-height="0pt" margin-left="-17px">
<xsl:call-template name="ns500_tab"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:if test="*[contains(@class, ' topic/row ')][2]">
<fo:table-row>
<xsl:for-each select="*[contains(@class, ' topic/row ')][2]/*[contains(@class, ' topic/entry ')]">
<fo:table-cell padding-top="6px" background-color="{$ns500_color}">
<xsl:if test="preceding-sibling::*[contains(@class, ' topic/entry ')]">
<xsl:attribute name="border-left-style">solid</xsl:attribute>
<xsl:attribute name="border-left-color">white</xsl:attribute>
<xsl:attribute name="border-left-width">3px</xsl:attribute>
</xsl:if>
<fo:block padding-bottom="6px" border-bottom="1px solid white"
xsl:use-attribute-sets="fontface_medium">
<fo:block margin-left="6px">
<xsl:apply-templates/>
</fo:block>
</fo:block>
</fo:table-cell>
</xsl:for-each>
</fo:table-row>
</xsl:if>
</fo:table-header>
</xsl:when>
<xsl:when test="$fec = 'NETSMART 1500'">
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block line-height="0pt" margin-left="-17px">
<xsl:call-template name="ns1500_tab"/>
</fo:block>
<xsl:if
test="following-sibling::*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')][2]">
<fo:block xsl:use-attribute-sets="thead.row.entry.sw.cont__content" background-color="{$ns1500_color}">
<fo:retrieve-table-marker retrieve-class-name="continued-text-sw-tbl"/>
</fo:block>
</xsl:if>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
</xsl:when>
<xsl:otherwise>
<fo:table-header xsl:use-attribute-sets="tgroup.thead">
<xsl:if test="$table_title and $first_tgroup_test = 'yes' and $parallel_test = 'no'">
<xsl:call-template name="thead__contents"/>
</xsl:if>
<xsl:apply-templates/>
</fo:table-header>
</xsl:otherwise>
</xsl:choose>


</xsl:template>

<xsl:template name="thead__contents">
<xsl:variable name="first_tgroup_test">
<xsl:choose>
<xsl:when
test="parent::*[contains(@class, ' topic/tgroup ')]/preceding-sibling::*[contains(@class, ' topic/tgroup ')]"
>no</xsl:when>
<xsl:otherwise>yes</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="table_title"
select="parent::*[contains(@class, ' topic/tgroup ')]/preceding-sibling::*[contains(@class, ' topic/title ')]"/>
<xsl:variable name="table_title_id"
select="parent::*[contains(@class, ' topic/tgroup ')]/preceding-sibling::*[contains(@class, ' topic/title ')]/@id"/>

<xsl:variable name="column-count" as="xs:integer">
<xsl:value-of select="count(parent::*[contains(@class, ' topic/tgroup ')]/*[contains(@class, ' topic/colspec ')])"
/>
</xsl:variable>


<fo:table-row xsl:use-attribute-sets="table__title__row">
<fo:table-cell number-columns-spanned="{$column-count}">
<fo:block xsl:use-attribute-sets="table__title" id="{$table_title_id}">
<fo:block color="{$table_num_color}">
<fo:inline>Table </fo:inline>
<xsl:number level="any"
count="*[contains(@class, ' topic/table ')]/*[contains(@class, ' topic/title ')][child::text()]" from="/"/>
<fo:retrieve-table-marker retrieve-class-name="continued-text"/>
</fo:block>
<xsl:copy-of
select="parent::*[contains(@class, ' topic/tgroup ')]/preceding-sibling::*[contains(@class, ' topic/title ')]/text()"
/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>

<xsl:template match="*[contains(@class, ' topic/colspec ')]">

<xsl:variable name="test_single_column">
<xsl:choose>
<xsl:when
test="
parent::*[contains(@class, ' topic/tgroup ')]/
*[contains(@class, ' topic/tbody ')]/
*[contains(@class, ' topic/row ')]/
*[contains(@class, ' topic/entry ')][2]"
>no</xsl:when>
<xsl:otherwise>yes</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="top_left1"
select="
parent::*[contains(@class, ' topic/tgroup ')]/
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]"/>

<xsl:variable name="top_left2"
select="
parent::*[contains(@class, ' topic/tgroup ')]/
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')]"/>


<xsl:variable name="top_left_test">
<xsl:choose>
<xsl:when test="$top_left1 = 'TL1'">yes</xsl:when>
<xsl:when test="$top_left2 = 'TL1'">yes</xsl:when>
<xsl:when test="$top_left1 = 'NETSMART 500'">yes</xsl:when>
<xsl:when test="$top_left2 = 'NETSMART 500'">yes</xsl:when>
<xsl:when test="$top_left1 = 'FLEXR GT'">yes</xsl:when>
<xsl:when test="$top_left2 = 'FLEXR GT'">yes</xsl:when>
<xsl:when test="$top_left1 = 'NETSMART 1500'">yes</xsl:when>
<xsl:when test="$top_left2 = 'NETSMART 1500'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>



<fo:table-column>
<xsl:attribute name="column-number">
<xsl:number count="colspec"/>
</xsl:attribute>
<xsl:if test="normalize-space(@colwidth) != ''">
<xsl:attribute name="column-width">
<xsl:choose>
<xsl:when test="$top_left_test = 'yes'">
<xsl:call-template name="calculateColumnWidth.Proportional">
<xsl:with-param name="colwidth" select="'600px'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$tableSpecNonProportional = 'true'">
<xsl:call-template name="calculateColumnWidth.nonProportional">
<xsl:with-param name="colwidth" select="@colwidth"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="calculateColumnWidth.Proportional">
<xsl:with-param name="colwidth" select="@colwidth"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>

<xsl:call-template name="applyAlignAttrs"/>
</fo:table-column>
</xsl:template>

<xsl:template match="*[contains(@class, ' topic/tbody ')]">
<xsl:param name="table_scale" tunnel="yes"/>
<xsl:variable name="test_single_column">
<xsl:choose>
<xsl:when test="
*[contains(@class, ' topic/row ')]/
*[contains(@class, ' topic/entry ')][2]"
>no</xsl:when>
<xsl:otherwise>yes</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="body_rule"
select="
preceding-sibling::*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')][1]"/>

<xsl:variable name="body_sub_rule"
select="
ancestor::*[contains(@class, ' topic/tbody ')]/preceding-sibling::*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')][1]"/>


<xsl:if
test="parent::tgroup/preceding-sibling::*[contains(@class, ' topic/title ')] and not(preceding-sibling::*[contains(@class, ' topic/thead ')])">
<fo:table-header xsl:use-attribute-sets="tgroup.thead">
<xsl:call-template name="thead__contents"/>
</fo:table-header>
</xsl:if>


<xsl:choose>
<xsl:when test="parent::tgroup/parent::table[@outputclass = 'screen']">
<fo:table-body xsl:use-attribute-sets="tgroup.tbody.screen">
<xsl:apply-templates/>
</fo:table-body>
</xsl:when>
<xsl:when test="$body_sub_rule = 'TL1'">
<fo:table-body xsl:use-attribute-sets="tgroup.tbody.tl1.sub">
<xsl:apply-templates/>
</fo:table-body>
</xsl:when>
<xsl:when test="$body_rule = 'TL1'">
<fo:table-body xsl:use-attribute-sets="tgroup.tbody.tl1">
<xsl:apply-templates/>
</fo:table-body>
</xsl:when>
<xsl:when test="$body_sub_rule = 'NETSMART 500'">
<fo:table-body xsl:use-attribute-sets="tgroup.tbody.ns500.sub">
<xsl:apply-templates/>
</fo:table-body>
</xsl:when>
<xsl:when test="$body_rule = 'NETSMART 500'">
<fo:table-body xsl:use-attribute-sets="tgroup.tbody.ns500">
<xsl:apply-templates/>
</fo:table-body>
</xsl:when>
<xsl:when test="$body_rule = 'FLEXR GT'">
<fo:table-body xsl:use-attribute-sets="tgroup.tbody.flxgt">
<xsl:apply-templates/>
</fo:table-body>
</xsl:when>
<xsl:when test="$body_rule = 'NETSMART 1500'">
<fo:table-body xsl:use-attribute-sets="tgroup.tbody.ns1500">
<xsl:apply-templates/>
</fo:table-body>
</xsl:when>
<xsl:when test="$body_rule = 'CLI'">
<fo:table-body xsl:use-attribute-sets="tgroup.tbody.CLI">
<xsl:apply-templates/>
</fo:table-body>
</xsl:when>
<xsl:when test="$body_rule = 'Terminal Emulator'">
<fo:table-body xsl:use-attribute-sets="tgroup.tbody.TERMEMUL">
<xsl:apply-templates/>
</fo:table-body>
</xsl:when>
<xsl:otherwise>
<fo:table-body xsl:use-attribute-sets="tgroup.tbody" font-size="{$table_scale}">
<xsl:apply-templates/>
</fo:table-body>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="*[contains(@class, ' topic/thead ')]/*[contains(@class, ' topic/row ')]">
<xsl:param name="table_scale" tunnel="yes"/>
<fo:table-row xsl:use-attribute-sets="thead.row" font-size="{$table_scale}">
<xsl:call-template name="rev_bar"/>
<xsl:apply-templates/>
</fo:table-row>
</xsl:template>


<xsl:template match="*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')]">
<xsl:param name="table_scale" tunnel="yes"/>

<xsl:if test="@outputclass = 'rowgroupstart' or @outputclass = 'subhead'">
<fo:table-row xsl:use-attribute-sets="tbody.row.group.start">
<xsl:call-template name="rev_bar"/>
</fo:table-row>
</xsl:if>
<fo:table-row xsl:use-attribute-sets="tbody.row" font-size="{$table_scale}">
<xsl:if test="@outputclass = 'rowgroupstart' or @outputclass = 'subhead'">
<xsl:attribute name="keep-with-next">always</xsl:attribute>
</xsl:if>
<xsl:call-template name="rev_bar"/>
<xsl:apply-templates/>
</fo:table-row>
<xsl:if test="@outputclass = 'rowgroupend'">
<fo:table-row xsl:use-attribute-sets="tbody.row.group.end">
<xsl:call-template name="rev_bar"/>
</fo:table-row>
</xsl:if>
</xsl:template>

<!-- TABLE CELL FORMATTING FOR THEAD -->

<xsl:template name="table_specs">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<xsl:if test="preceding-sibling::entry and @morerows">
<xsl:attribute name="border-left-color">
<xsl:value-of select="$thead_vert_line_color"/>
</xsl:attribute>
<xsl:attribute name="border-left-width">.5pt</xsl:attribute>
<xsl:attribute name="border-left-style">solid</xsl:attribute>
</xsl:if>
</xsl:template>

<xsl:template
match="*[contains(@class, ' topic/thead ')]/*[contains(@class, ' topic/row ')]/*[contains(@class, ' topic/entry ')]">

<xsl:choose>

<xsl:when
test="
ancestor::*[contains(@class, ' topic/table ')]/ancestor::*[contains(@class, ' topic/tgroup ')]/*[contains(@class, ' topic/thead ')]/*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1]/*[contains(@class, ' topic/p ')] = 'NETSMART 500'">
<fo:table-cell xsl:use-attribute-sets="thead.row.entry.ns500.sub">
<xsl:call-template name="table_specs"/>
<fo:block xsl:use-attribute-sets="thead.row.entry__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:when>

<xsl:when
test="
ancestor::*[contains(@class, ' topic/table ')]/ancestor::*[contains(@class, ' topic/tgroup ')][1]/
*[contains(@class, ' topic/thead ')]/*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1]/*[contains(@class, ' topic/p ')] = 'TL1'">
<fo:table-cell xsl:use-attribute-sets="thead.row.entry.tl1.sub">
<xsl:call-template name="table_specs"/>
<fo:block xsl:use-attribute-sets="thead.row.entry__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:when>

<xsl:when
test="
ancestor::*[contains(@class, ' topic/table ')][contains(@rowheader, 'firstcol')] and
not(preceding-sibling::*[contains(@class, ' topic/entry ')]) and
not(*)">
<fo:table-cell xsl:use-attribute-sets="thead.row.entry.blank">
<xsl:call-template name="table_specs"/>
</fo:table-cell>
</xsl:when>

<xsl:otherwise>
<fo:table-cell xsl:use-attribute-sets="thead.row.entry">
<xsl:call-template name="table_specs"/>
<xsl:choose>
<xsl:when
test="self::*[@outputclass = 'rotate'] or ancestor::*[contains(@class, ' topic/table ')][@outputclass = 'thead-rotate']">
<xsl:attribute name="display-align">after</xsl:attribute>
<fo:block-container reference-orientation="90" height="100%" display-align="center">
<fo:block xsl:use-attribute-sets="thead.row.entry__content.rotate">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:block-container>
</xsl:when>
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="thead.row.entry__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:table-cell>
</xsl:otherwise>
</xsl:choose>


</xsl:template>


<!-- EOLSON - GENERAL TEMPLATE FOR DEFINING FORMATTING OF TABLE CELLS -->
<xsl:template
match="*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')]/*[contains(@class, ' topic/entry ')]">

<xsl:variable name="test_single_column">
<xsl:choose>
<xsl:when test="following-sibling::*[contains(@class, ' topic/entry ')]">no</xsl:when>
<xsl:otherwise>yes</xsl:otherwise>
</xsl:choose>
</xsl:variable>



<xsl:variable name="colname_test" select="@colname"/>
<xsl:variable name="rownum_1"
select="count(parent::*[contains(@class, ' topic/row ')]/preceding-sibling::*[contains(@class, ' topic/row ')]) + 1"/>
<xsl:variable name="rownum_2" select="$rownum_1 div 2"/>
<xsl:variable name="rowheader_test1"
select="
parent::*[contains(@class, ' topic/row ')]/
parent::*[contains(@class, ' topic/tbody ')]/
parent::*[contains(@class, ' topic/tgroup ')]/
parent::*[contains(@class, ' topic/table ')]/@rowheader"/>
<xsl:variable name="rowheader_test2">
<xsl:choose>
<xsl:when test="not(preceding-sibling::*[contains(@class, ' topic/entry ')] and @colname = '1')">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="rowheader_test3">
<xsl:choose>
<xsl:when test="contains($rowheader_test1, 'firstcol') and contains($colname_test, '1')">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="tl1_test1"
select="
ancestor::*[contains(@class, ' topic/tbody ')]/preceding-sibling::*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/*[contains(@class, ' topic/entry ')][1]
[not(following-sibling::*[contains(@class, ' topic/entry ')])]"/>
<xsl:variable name="tl1_test2"
select="
ancestor::*[contains(@class, ' topic/tbody ')]/preceding-sibling::*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/*[contains(@class, ' topic/entry ')][1]
[not(following-sibling::*[contains(@class, ' topic/entry ')])]/*[contains(@class, ' topic/p ')]"/>

<xsl:variable name="cli_test1"
select="
ancestor::*[contains(@class, ' topic/tbody ')]/preceding-sibling::*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/*[contains(@class, ' topic/entry ')][1]
[not(following-sibling::*[contains(@class, ' topic/entry ')])]"/>
<xsl:variable name="cli_test2"
select="
ancestor::*[contains(@class, ' topic/tbody ')]/preceding-sibling::*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/*[contains(@class, ' topic/entry ')][1]
[not(following-sibling::*[contains(@class, ' topic/entry ')])]/*[contains(@class, ' topic/p ')]"/>

<xsl:variable name="termemul_test1"
select="
ancestor::*[contains(@class, ' topic/tbody ')]/preceding-sibling::*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/*[contains(@class, ' topic/entry ')][1]
[not(following-sibling::*[contains(@class, ' topic/entry ')])]"/>
<xsl:variable name="termemul_test2"
select="
ancestor::*[contains(@class, ' topic/tbody ')]/preceding-sibling::*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/*[contains(@class, ' topic/entry ')][1]
[not(following-sibling::*[contains(@class, ' topic/entry ')])]/*[contains(@class, ' topic/p ')]"/>

<xsl:variable name="ns500_test1"
select="
ancestor::*[contains(@class, ' topic/tgroup ')]/
following-sibling::*[contains(@class, ' topic/tgroup ')]/
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]"/>

<xsl:variable name="ns500_test2"
select="
ancestor::*[contains(@class, ' topic/tgroup ')]/
following-sibling::*[contains(@class, ' topic/tgroup ')]/
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')]"/>

<xsl:variable name="flxgt_test1"
select="
ancestor::*[contains(@class, ' topic/tgroup ')]/
following-sibling::*[contains(@class, ' topic/tgroup ')]/
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]"/>

<xsl:variable name="flxgt_test2"
select="
ancestor::*[contains(@class, ' topic/tgroup ')]/
following-sibling::*[contains(@class, ' topic/tgroup ')]/
*[contains(@class, ' topic/thead ')]/
*[contains(@class, ' topic/row ')][1]/
*[contains(@class, ' topic/entry ')][1][not(following-sibling::*[contains(@class, ' topic/entry ')])]/
*[contains(@class, ' topic/p ')]"/>

<xsl:variable name="subtable_test">
<xsl:choose>
<xsl:when test="ancestor::*[contains(@class, ' topic/tgroup ')]/ancestor::*[contains(@class, ' topic/tgroup ')]"
>yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="tl1_string">TL1</xsl:variable>
<xsl:variable name="tl1_db_string">TL1 (Default in Bold)</xsl:variable>
<xsl:variable name="ns500_string">NETSMART 500</xsl:variable>
<xsl:variable name="flxgt_string">FLEXR GT</xsl:variable>
<xsl:variable name="ns1500_string">NETSMART 1500</xsl:variable>
<xsl:variable name="cli_string">CLI</xsl:variable>
<xsl:variable name="termemul_string">Terminal Emulator</xsl:variable>
<xsl:variable name="yes_string">yes</xsl:variable>

<xsl:variable name="tl1_test3">
<xsl:choose>
<xsl:when test="$tl1_test1 = $tl1_string">yes</xsl:when>
<xsl:when test="$tl1_test1 = $tl1_db_string">yes</xsl:when>
<xsl:when test="$tl1_test2 = $tl1_string">yes</xsl:when>
<xsl:when test="$tl1_test2 = $tl1_db_string">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="cli_test3">
<xsl:choose>
<xsl:when test="$cli_test1 = $cli_string">yes</xsl:when>
<xsl:when test="$cli_test2 = $cli_string">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="termemul_test3">
<xsl:choose>
<xsl:when test="$termemul_test1 = $termemul_string">yes</xsl:when>
<xsl:when test="$termemul_test2 = $termemul_string">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="ns500_test3">
<xsl:choose>
<xsl:when test="$tl1_test1 = $ns500_string">yes</xsl:when>
<xsl:when test="$tl1_test2 = $ns500_string">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="flxgt_test3">
<xsl:choose>
<xsl:when test="$tl1_test1 = $flxgt_string">yes</xsl:when>
<xsl:when test="$tl1_test2 = $flxgt_string">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="ns500_subtest">
<xsl:choose>
<xsl:when test="$subtable_test = $yes_string and $tl1_test1 = $ns500_string">yes</xsl:when>
<xsl:when test="$subtable_test = $yes_string and $tl1_test2 = $ns500_string">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="tl1_subtest">
<xsl:choose>
<xsl:when test="$subtable_test = $yes_string and $tl1_test3 = 'yes'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="ns1500_test1">
<xsl:choose>
<xsl:when test="$tl1_test1 = $ns1500_string">yes</xsl:when>
<xsl:when test="$tl1_test2 = $ns1500_string">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="half">
<xsl:value-of select="string(.5)"/>
</xsl:variable>
<xsl:variable name="rownum_2_string">
<xsl:value-of select="string($rownum_2)"/>
</xsl:variable>

<xsl:variable name="odd_or_even">
<xsl:choose>
<xsl:when test="$tl1_test3 = $yes_string">tl1_SWT</xsl:when>
<xsl:when test="$cli_test3 = $yes_string">cli_SWT</xsl:when>
<xsl:when test="$termemul_test3 = $yes_string">termemul_SWT</xsl:when>
<xsl:when test="$ns500_test3 = $yes_string">ns500_SWT</xsl:when>
<xsl:when test="$flxgt_test3 = $yes_string">flxgt_SWT</xsl:when>
<xsl:when test="$ns1500_test1 = $yes_string">ns1500_SWT</xsl:when>
<xsl:when test="contains($rownum_2_string, $half)">odd</xsl:when>
<xsl:otherwise>even</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="first_row_test">
<xsl:choose>
<xsl:when
test="parent::*[contains(@class, ' topic/row ')][not(preceding-sibling::*[contains(@class, ' topic/row ')])]"
>yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="subhead_row_test">
<xsl:choose>
<xsl:when test="parent::*[contains(@class, ' topic/row ')]/@outputclass = 'subhead'">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<!-- THE FOLLOWING ARE VARIOUS CONDITIONS POSSIBLE FOR TABLE BODY CELLS -->

<xsl:choose>

<!-- CONDITION 1: SCREEN TABLES -->
<xsl:when test="parent::row/parent::tbody/parent::tgroup/parent::table/@outputclass = 'screen'">
<fo:table-cell xsl:use-attribute-sets="tbody.row.entry.screen">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:table-cell>
</xsl:when>

<!-- CONDITION 1: TABLE SUB HEAD ROWS -->
<xsl:when test="$subhead_row_test = 'yes'">
<fo:table-cell xsl:use-attribute-sets="tbody.row.subhead.entry">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<xsl:choose>
<xsl:when test="$first_row_test = 'yes'">
<fo:block xsl:use-attribute-sets="tbody.row.subhead.entry__content">
<xsl:call-template name="rev_bar"/>
<fo:marker marker-class-name="continued-text"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="tbody.row.subhead.entry__content">
<xsl:call-template name="rev_bar"/>
<fo:marker marker-class-name="continued-text"> (Cont.)</fo:marker>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:table-cell>
</xsl:when>

<!-- CONDITION 2: TABLE FRAME ATTRIBUTE SET TO NONE -->
<xsl:when
test="ancestor::*[contains(@class, '- topic/tgroup ')][parent::*[contains(@class, ' topic/table ')][@frame = 'none']]">
<fo:table-cell xsl:use-attribute-sets="tbody.row.entry.nolines">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<fo:block xsl:use-attribute-sets="tbody.row.entry.nolines__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:when>

<!-- CONDITION 3: NETSMART 500 SUB TABLE WITH ROW HEADER -->
<xsl:when test="contains($rowheader_test3, 'yes') and $ns500_test3 = $yes_string">
<fo:table-cell xsl:use-attribute-sets="thead.row.entry.ns500.sub">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<fo:block xsl:use-attribute-sets="thead.row.entry__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:when>

<!-- CONDITION 4: NETSMART 500 SUB TABLE -->
<xsl:when test="$ns500_subtest = $yes_string">
<fo:table-cell xsl:use-attribute-sets="tbody.row.entry.ns500.sub">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<fo:block xsl:use-attribute-sets="tbody.row.entry.sub__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:when>

<!-- CONDITION 5: TL1 SUB TABLE BODY ROW -->
<xsl:when test="$tl1_subtest = $yes_string">
<fo:table-cell xsl:use-attribute-sets="tbody.row.entry.tl1.sub">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<fo:block xsl:use-attribute-sets="tbody.row.entry.sub__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:when>

<!-- CONDITION 6: ROWHEADER ATTRIBUTE SET BUT NOT IN HORIZONTALLY STRADDLED CELLS -->
<xsl:when test="not(@namest) and contains($rowheader_test3, 'yes')">
<fo:table-cell xsl:use-attribute-sets="thead.row.entry">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>

<xsl:choose>
<xsl:when
test="self::*[@outputclass = 'rotate'] or ancestor::*[contains(@class, ' topic/table ')][@outputclass = 'firstcol-rotate']">
<fo:block-container reference-orientation="90">
<fo:block xsl:use-attribute-sets="thead.row.entry__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:block-container>
</xsl:when>
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="thead.row.entry__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:table-cell>
</xsl:when>

<!-- CONDITION 7: SOFTWARE TABLE -->
<xsl:when test="contains($odd_or_even, '_SWT')">
<fo:table-cell xsl:use-attribute-sets="tbody.row.entry.none">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<xsl:choose>
<xsl:when test="$first_row_test = 'yes'">
<fo:marker marker-class-name="continued-text-sw-tbl"/>
</xsl:when>
<xsl:otherwise>
<fo:marker marker-class-name="continued-text-sw-tbl"> (Continued from previous page)</fo:marker>
</xsl:otherwise>
</xsl:choose>

<fo:block xsl:use-attribute-sets="tbody.row.entry__content_1">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>

</fo:table-cell>
</xsl:when>

<!-- CONDITION 8: DESCRIPTION CELL AS SPECIFIED -->
<xsl:when test="@outputclass = 'description'">
<fo:table-cell xsl:use-attribute-sets="tbody.row.entry.description">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<fo:block xsl:use-attribute-sets="tbody.row.entry__content_1">
<xsl:call-template name="rev_bar"/>
<fo:marker marker-class-name="continued-text"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:when>

<!-- CONDITION 9: FIRST ROW OF TABLE -->
<xsl:when test="$first_row_test = 'yes'">
<fo:table-cell xsl:use-attribute-sets="tbody.row.entry.odd">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<fo:block xsl:use-attribute-sets="tbody.row.entry__content_1">
<xsl:call-template name="rev_bar"/>
<fo:marker marker-class-name="continued-text"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:when>

<!-- CONDITION 10: ODD ROWS OF TABLE -->
<xsl:when test="$odd_or_even = 'odd'">
<fo:table-cell xsl:use-attribute-sets="tbody.row.entry.odd">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<xsl:if test="preceding-sibling::entry and @morerows">
<xsl:attribute name="border-left-color">
<xsl:value-of select="$table_vert_line_color"/>
</xsl:attribute>
<xsl:attribute name="border-left-width">.5pt</xsl:attribute>
<xsl:attribute name="border-left-style">solid</xsl:attribute>
<xsl:attribute name="border-right-color">
<xsl:value-of select="$table_vert_line_color"/>
</xsl:attribute>
<xsl:attribute name="border-right-width">.5pt</xsl:attribute>
<xsl:attribute name="border-right-style">solid</xsl:attribute>
</xsl:if>
<fo:block xsl:use-attribute-sets="tbody.row.entry__content_1">
<xsl:call-template name="rev_bar"/>
<fo:marker marker-class-name="continued-text"> (Cont.)</fo:marker>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:when>

<!-- CONDITION 11: EVEN ROWS OF TABLE -->
<xsl:otherwise>
<fo:table-cell xsl:use-attribute-sets="tbody.row.entry.even">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<xsl:if test="preceding-sibling::entry and @morerows">
<xsl:attribute name="border-left-color">
<xsl:value-of select="$table_vert_line_color"/>
</xsl:attribute>
<xsl:attribute name="border-left-width">.5pt</xsl:attribute>
<xsl:attribute name="border-left-style">solid</xsl:attribute>
<xsl:attribute name="border-right-color">
<xsl:value-of select="$table_vert_line_color"/>
</xsl:attribute>
<xsl:attribute name="border-right-width">.5pt</xsl:attribute>
<xsl:attribute name="border-right-style">solid</xsl:attribute>
</xsl:if>
<fo:block xsl:use-attribute-sets="tbody.row.entry__content_1">
<xsl:call-template name="rev_bar"/>
<fo:marker marker-class-name="continued-text"> (Cont.)</fo:marker>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<!-- EOLSON - DEFINES FORMATTING OF FIRST BODY COLUMN TABLE CELLS WHEN ROWHEADER SET TO FIRSTCOL -->
<xsl:template
match="
*[contains(@class, ' topic/table ')][contains(@rowheader, 'firstcol')]//
*[contains(@class, ' topic/body ')]/*[contains(@class, ' topic/row ')]/*[contains(@class, ' topic/entry ')][not(preceding-sibling::*[contains(@class, ' topic/entry ')])]">
<fo:table-cell xsl:use-attribute-sets="thead.row.entry">
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<xsl:choose>
<xsl:when test="ancestor-or-self::*[contains(@outputclass, 'rotate')]">
<fo:block-container reference-orientation="90">
<fo:block xsl:use-attribute-sets="thead.row.entry__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:block-container>
</xsl:when>
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="thead.row.entry__content">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="processEntryContent"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:table-cell>
</xsl:template>

<!-- EOLSON - TABLE ATTRIBUTES FOR TL1/NS TABLES -->

<xsl:template name="displayAtts_screen">
<xsl:param name="element"/>
<xsl:call-template name="processAttrSetReflection">
<xsl:with-param name="attrSet" select="'table__tableframe__screen'"/>
<xsl:with-param name="path" select="$tableAttrs"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="displayAtts_TL1_NS">
<xsl:param name="element"/>
<xsl:call-template name="processAttrSetReflection">
<xsl:with-param name="attrSet" select="'table__tableframe__tl1_ns'"/>
<xsl:with-param name="path" select="$tableAttrs"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="displayAtts_CLI">
<xsl:param name="element"/>
<xsl:call-template name="processAttrSetReflection">
<xsl:with-param name="attrSet" select="'table__tableframe__cli'"/>
<xsl:with-param name="path" select="$tableAttrs"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="displayAtts_TERMEMUL">
<xsl:param name="element"/>
<xsl:call-template name="processAttrSetReflection">
<xsl:with-param name="attrSet" select="'table__tableframe__termemul'"/>
<xsl:with-param name="path" select="$tableAttrs"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="displayAtts_NS_sub">
<xsl:param name="element"/>
<xsl:call-template name="processAttrSetReflection">
<xsl:with-param name="attrSet" select="'table__tableframe__ns_sub'"/>
<xsl:with-param name="path" select="$tableAttrs"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="displayAtts_TL1_sub">
<xsl:param name="element"/>
<xsl:call-template name="processAttrSetReflection">
<xsl:with-param name="attrSet" select="'table__tableframe__tl1_sub'"/>
<xsl:with-param name="path" select="$tableAttrs"/>
</xsl:call-template>
</xsl:template>



<xsl:template
match="
*[contains(@class, ' topic/tgroup ')][@platform = 'NS_500']/
*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')]/*[contains(@class, ' topic/entry ')][2]">

<fo:table-cell padding-top="6px" background-color="{$ns500_color}">
<xsl:if test="preceding-sibling::*[contains(@class, ' topic/entry ')]">
<xsl:attribute name="border-left-style">solid</xsl:attribute>
<xsl:attribute name="border-left-color">white</xsl:attribute>
<xsl:attribute name="border-left-width">3px</xsl:attribute>
<xsl:attribute name="padding">6px</xsl:attribute>
</xsl:if>
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>




<!--Definition list-->
<xsl:template match="*[contains(@class, ' topic/dl ')]">

<xsl:if test="@outputclass = 'legend'">
<fo:block xsl:use-attribute-sets="dl.legend.title">
<xsl:call-template name="rev_bar"/>
<fo:inline>Legend:</fo:inline></fo:block>
</xsl:if>

<xsl:if test="@outputclass = 'cautions'">
<fo:block xsl:use-attribute-sets="cautions__dl">
<xsl:call-template name="rev_bar"/>
<fo:inline>
<xsl:call-template name="admonish_caution_dl"/>
</fo:inline>
</fo:block>
</xsl:if>

<fo:table xsl:use-attribute-sets="dl">
<xsl:call-template name="commonattributes"/>

<xsl:if test="@scale">
<xsl:variable name="fs1" select="@scale"/>
<xsl:variable name="fs2" select="$fs1 div 10"/>
<xsl:variable name="fs3" select="string($fs2)"/>
<xsl:variable name="fs4" select="concat($fs3, 'pt')"/>
<xsl:attribute name="font-size">
<xsl:choose>
<xsl:when test="@scale">
<xsl:value-of select="$fs4"/>
</xsl:when>
<xsl:otherwise>10pt</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="*[contains(@class, ' topic/dlhead ')]"/>
<fo:table-body xsl:use-attribute-sets="dl__body">
<xsl:apply-templates select="*[contains(@class, ' topic/dlentry ')]"/>
</fo:table-body>
</fo:table>

</xsl:template>

<xsl:template match="*[contains(@class, ' topic/dl ')]/*[contains(@class, ' topic/dlhead ')]">
<fo:table-header xsl:use-attribute-sets="dl.dlhead">
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="rev_bar"/>
<fo:table-row xsl:use-attribute-sets="dl.dlhead__row">
<xsl:apply-templates/>
</fo:table-row>
</fo:table-header>
</xsl:template>

<xsl:template match="*[contains(@class, ' topic/dlhead ')]/*[contains(@class, ' topic/dthd ')]">
<fo:table-cell xsl:use-attribute-sets="dlhead.dthd__cell">
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="rev_bar"/>
<fo:block xsl:use-attribute-sets="dlhead.dthd__content">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>

<xsl:template match="*[contains(@class, ' topic/dlhead ')]/*[contains(@class, ' topic/ddhd ')]">
<fo:table-cell xsl:use-attribute-sets="dlhead.ddhd__cell">
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="rev_bar"/>
<fo:block xsl:use-attribute-sets="dlhead.ddhd__content">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>

<xsl:template match="*[contains(@class, ' topic/dlentry ')]">

<xsl:choose>
<xsl:when test="ancestor::*[contains(@class, ' topic/dd ')]">
<fo:table-row xsl:use-attribute-sets="dlentry">
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="rev_bar"/>
<fo:table-cell xsl:use-attribute-sets="dlentry.dt.sub">
<xsl:apply-templates select="*[contains(@class, ' topic/dt ')]"/>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="dlentry.dd.sub">
<xsl:apply-templates select="*[contains(@class, ' topic/dd ')]"/>
</fo:table-cell>
</fo:table-row>
</xsl:when>

<xsl:when
test="
not(ancestor::*[contains(@class, ' pr-d/parml ')])
and not(preceding-sibling::*[contains(@class, ' topic/dlhead ')])
and not(parent::dl[@pagination = 'normal'])
and ((descendant::*[contains(@class, ' topic/dl ')] or descendant::*[contains(@class, ' topic/table ')])
or (preceding-sibling::*[contains(@class, ' topic/dlentry ')]/descendant::*[contains(@class, ' topic/dl ')]
or preceding-sibling::*[contains(@class, ' topic/dlentry ')]/descendant::*[contains(@class, ' topic/table ')])
or (following-sibling::*[contains(@class, ' topic/dlentry ')]/descendant::*[contains(@class, ' topic/dl ')]
or following-sibling::*[contains(@class, ' topic/dlentry ')]/descendant::*[contains(@class, ' topic/table ')]
or parent::dl/@pagination = 'pagewide'))">

<fo:table-row xsl:use-attribute-sets="dlentry" keep-with-next="always">
<xsl:call-template name="rev_bar"/>
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="rev_bar"/>
<fo:table-cell xsl:use-attribute-sets="dlentry.dt2">
<xsl:apply-templates select="*[contains(@class, ' topic/dt ')]"/>
</fo:table-cell>
</fo:table-row>
<fo:table-row xsl:use-attribute-sets="dlentry" keep-with-previous="always">
<fo:table-cell xsl:use-attribute-sets="dlentry.dd2">
<xsl:apply-templates select="*[contains(@class, ' topic/dd ')]"/>
</fo:table-cell>
</fo:table-row>
</xsl:when>

<xsl:otherwise>
<fo:table-row xsl:use-attribute-sets="dlentry">
<xsl:call-template name="rev_bar"/>
<xsl:if test="parent::dl/parent::section[@cols]">
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
</xsl:if>
<xsl:call-template name="commonattributes"/>
<fo:table-cell xsl:use-attribute-sets="dlentry.dt">
<xsl:apply-templates select="*[contains(@class, ' topic/dt ')]"/>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="dlentry.dd">
<xsl:apply-templates select="*[contains(@class, ' topic/dd ')]"/>
</fo:table-cell>
</fo:table-row>
</xsl:otherwise>
</xsl:choose>


</xsl:template>

<xsl:template match="*[contains(@class, ' topic/dt ')]">
<xsl:choose>
<xsl:when test="ancestor::*[contains(@class, ' topic/dd ')]">
<fo:block xsl:use-attribute-sets="dlentry_sub.dt__content">
<xsl:call-template name="rev_bar"/>
<xsl:apply-templates/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="dlentry.dt__content">
<xsl:call-template name="rev_bar"/>
<xsl:apply-templates/>
</fo:block>
</xsl:otherwise>
</xsl:choose>

</xsl:template>

<xsl:template match="*[contains(@class, ' topic/dd ')]">
<xsl:choose>
<xsl:when test="ancestor::*[contains(@class, ' topic/dd ')]">
<fo:block xsl:use-attribute-sets="dlentry_sub.dd__content">
<xsl:call-template name="rev_bar"/>
<xsl:apply-templates/>
</fo:block>
</xsl:when>
<xsl:when test="@cols">
<fo:block-container xsl:use-attribute-sets="dlentry.dd__content">
<xsl:copy-of select="@id"/>
<xsl:attribute name="axf:column-count">
<xsl:value-of select="@cols"/>
</xsl:attribute>
<xsl:attribute name="axf:column-gap">6pt</xsl:attribute>
<xsl:attribute name="axf:column-fill">balance</xsl:attribute>
<xsl:call-template name="rev_bar"/>
<xsl:apply-templates/>
</fo:block-container>
</xsl:when>
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="dlentry.dd__content">
<xsl:call-template name="rev_bar"/>
<xsl:apply-templates/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="*[contains(@class, ' topic/dd ')]/*[contains(@class, ' topic/p ')][not(preceding-sibling::*)]">
<fo:block xsl:use-attribute-sets="p" space-before="0pt" keep-with-next="always">
<xsl:call-template name="rev_bar"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template
match="*[contains(@class, ' topic/dd ')]//*[contains(@class, ' topic/stentry ')]/*[contains(@class, ' topic/p ')]">
<fo:block xsl:use-attribute-sets="dlentry.dd.stentry">
<xsl:call-template name="rev_bar"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>


<!-- END OF DEFINITION LIST -->

<xsl:template
match="*[contains(@class, ' topic/table ')][@outputclass = 'parallel']/*[contains(@class, ' topic/title ')]">
<fo:block xsl:use-attribute-sets="table__title">
<fo:block color="{$table_num_color}">
<fo:inline>Table </fo:inline>
<xsl:number level="any"
count="*[contains(@class, ' topic/table ')]/*[contains(@class, ' topic/title ')][child::text()]" from="/"/>
</fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template
match="*[contains(@class, ' topic/fig ')]//*[contains(@class, ' topic/stentry ')][not(*[contains(@class, ' topic/image ')])]/*[contains(@class, ' topic/p ')][not(preceding-sibling::*)]">
<xsl:variable name="entry_count" select="count(parent::*/preceding-sibling::*) + 1"/>
<xsl:variable name="corresponding_image"
select="ancestor::*[contains(@class, ' topic/strow ')]/preceding-sibling::*[//image]/stentry[position() = $entry_count]/image/@align"/>
<xsl:variable name="alignment">
<xsl:choose>
<xsl:when test="$corresponding_image != ''">
<xsl:value-of select="$corresponding_image"/>
</xsl:when>
<xsl:otherwise>left</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<fo:block xsl:use-attribute-sets="fig.sub.caption" text-align="{$alignment}">
<xsl:apply-templates/>
</fo:block>
</xsl:template>


</xsl:stylesheet>
    (1-1/1)