Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial check-in with an example bill.

  • Loading branch information...
commit 59586d76ce55a2224c5e0d82db4622870dc6d934 1 parent ab338ee
sjs authored
Showing with 26,376 additions and 0 deletions.
  1. +5,522 −0 bill.dtd
  2. +18,611 −0 billres.xsl
  3. +91 −0 h65_ih.xml
  4. +2,152 −0 table.xsl
View
5,522 bill.dtd
5,522 additions, 0 deletions not shown
View
18,611 billres.xsl
18,611 additions, 0 deletions not shown
View
91 h65_ih.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="billres.xsl"?>
+<!--<?xml version="1.0"?>
+-->
+<!--<!DOCTYPE bill PUBLIC "-//US Congress//DTDs/bill.dtd//EN" "C:\Program Files\JustSystems\rules\bill.dtd" []>
+-->
+<!DOCTYPE bill PUBLIC "-//US Congress//DTDs/bill v2.8 20020720//EN" "bill.dtd">
+<bill bill-stage="Introduced-in-House" bill-type="olc" dms-id="H9C8D710A7E0340A8A2ADBACF73CC7D91" public-private="public">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+<dublinCore>
+<dc:title>112 HR 65 IH: Candy Tobacco Tax Parity Act of 2011</dc:title>
+<dc:publisher>U.S. House of Representatives</dc:publisher>
+<dc:date>2011-01-05</dc:date>
+<dc:format>text/xml</dc:format>
+<dc:language>EN</dc:language>
+<dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
+</dublinCore>
+</metadata>
+<form>
+ <distribution-code display="yes">I</distribution-code>
+ <congress>112th CONGRESS</congress>
+ <session>1st Session</session>
+ <legis-num>H. R. 65</legis-num>
+ <current-chamber>IN THE HOUSE OF REPRESENTATIVES</current-chamber>
+ <action>
+ <action-date date="20110105">January 5, 2011</action-date>
+ <action-desc><sponsor name-id="D000399">Mr. Doggett</sponsor>
+ introduced the following bill; which was referred to the
+ <committee-name committee-id="HWM00">Committee on Ways and
+ Means</committee-name></action-desc>
+ </action>
+ <legis-type>A BILL</legis-type>
+ <official-title>To amend the Internal Revenue Code of 1986 to provide for
+ the taxation of smokeless tobacco products sold as discrete single-use
+ units.</official-title>
+ </form>
+ <legis-body id="HD91534D54B594BDAB527158EE5768B9C" style="OLC">
+ <section id="H32B88311778C40EFB83BE6E88DF446E5" section-type="section-one"><enum>1.</enum><header>Short title</header><text display-inline="no-display-inline">This Act may be cited as the
+ <quote><short-title>Candy Tobacco Tax Parity Act of
+ 2011</short-title></quote>.</text>
+ </section><section id="H4E7114B8511A4B42AB626929391BECFA"><enum>2.</enum><header>Taxation of
+ discrete single-use unit smokeless tobacco</header>
+ <subsection id="H707AD0D18CAA4E7DA22FF3D470D922D7"><enum>(a)</enum><header>In
+ general</header><text display-inline="yes-display-inline">Subsection (e) of
+ <external-xref legal-doc="usc" parsable-cite="usc/26/5701">section 5701</external-xref> of the Internal Revenue Code of 1986 is amended by adding at the
+ end the following new paragraph:</text>
+ <quoted-block display-inline="no-display-inline" id="H47D877C8F4224F8F9E4A8ECA2358525B" style="OLC">
+ <paragraph id="HFB4224A4940D409283B2D3B3784FAB5C"><enum>(3)</enum><header>Discrete
+ single-use unit products</header><text display-inline="yes-display-inline">On
+ discrete single-use units, an amount per thousand units equal to the amount per
+ thousand cigarettes in effect under subsection (b)(1) (relating to small
+ cigarettes).</text>
+ </paragraph><after-quoted-block>.</after-quoted-block></quoted-block>
+ </subsection><subsection id="H1B9126AE56FF4DB5B3DED94BCCCD539B"><enum>(b)</enum><header>Modification of
+ smokeless tobacco definition To include discrete single-Use units</header>
+ <paragraph id="H687DAFFD22B249EDBBD1F898E9B691AB"><enum>(1)</enum><header>In
+ general</header><text display-inline="yes-display-inline">Paragraph (1) of
+ section 5702(m) of such Code is amended by striking <quote>or chewing
+ tobacco</quote> and inserting <quote>, chewing tobacco, or discrete single-use
+ unit</quote>.</text>
+ </paragraph><paragraph id="H8C7A86ADA4634506A47147AC7630E2CF"><enum>(2)</enum><header>Discrete
+ single-use units defined</header><text>Subsection (m) of section 5702 of such
+ Code is amended by adding at the end the following new paragraph:</text>
+ <quoted-block display-inline="no-display-inline" id="H968B33C7D49144419B9E2A8CF79C9163" style="OLC">
+ <paragraph id="HD91F157F972D4F6D83505E14403AE8F5"><enum>(4)</enum><header>Discrete
+ single-use unit</header><text display-inline="yes-display-inline">The term
+ <quote>discrete single-use unit</quote> means any product containing tobacco
+ that—</text>
+ <subparagraph id="H63051E3B4FDF458FB98D3262A38E3956"><enum>(A)</enum><text display-inline="yes-display-inline">is intended or expected to be consumed
+ without being combusted, and</text>
+ </subparagraph><subparagraph id="H8D42E8BF18C945418B3B0E6A0B4FC8DE"><enum>(B)</enum><text>is in the form of
+ a lozenge, tablet, pill, pouch, dissolvable strip, or other discrete single-use
+ or single-dose
+ unit.</text>
+ </subparagraph></paragraph><after-quoted-block>.</after-quoted-block></quoted-block>
+ </paragraph></subsection><subsection commented="no" id="H19350AEE54ED488B934D1427A7E19435"><enum>(c)</enum><header>Conforming
+ amendments</header><text display-inline="yes-display-inline">Subsection (e) of
+ section 5701 of such Code is amended—</text>
+ <paragraph commented="no" id="H5D4D6A2EE24C45E88AD77FA698977671"><enum>(1)</enum><text>by striking
+ <quote>On snuff</quote> in paragraph (1) and inserting <quote>On snuff not
+ described in paragraph (3)</quote>, and</text>
+ </paragraph><paragraph commented="no" id="HD668DB1D6A1B44B892A5B61E6279C038"><enum>(2)</enum><text>by striking
+ <quote>On chewing tobacco</quote> in paragraph (2) and inserting <quote>On
+ chewing tobacco not described in paragraph (3)</quote>.</text>
+ </paragraph></subsection><subsection id="HE332A2225CAB4E3AB3725FF8A37968D2"><enum>(d)</enum><header>Effective
+ Date</header><text>The amendments made by this section shall apply to articles
+ removed (as defined in <external-xref legal-doc="usc" parsable-cite="usc/26/5702">section 5702(j)</external-xref> of the Internal Revenue Code of 1986)
+ after the date that is 180 days after the date of the enactment of this
+ Act.</text>
+ </subsection></section></legis-body>
+</bill>
View
2,152 table.xsl
@@ -0,0 +1,2152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- =========================================================== -->
+<!-- MODULE: Table XSL for Legislative Branch Bills XSLT -->
+<!-- VERSION: 1.9/Table Companion for billres.xsl 1.9 -->
+<!-- DATE: February 8, 2008 -->
+<!-- Previous version and date: -->
+<!-- =============================================================
+ Formal Public Identifier:
+ Table.xsl -->
+<!-- SYSTEM: Legislative Branch XSL -->
+<!-- PURPOSE: Contains specific information for display of -->
+<!-- tables in Bills and Resolutions on the web -->
+<!-- -->
+<!-- CONTAINS: 1) Calls to res.dtd and bill.dtd -->
+<!-- 2) Overall structure of a Bill, Resolution, -->
+<!-- Amendments -->
+<!-- -->
+<!-- MODULES REQUIRED: -->
+<!-- XSL and DTD Common Elements -->
+<!-- -->
+<!-- CREATED FOR: -->
+<!-- House of Representatives, Senate and The Library -->
+<!-- of Congress -->
+<!-- ORIGINAL CREATION DATE: -->
+<!-- February 6, 2004 -->
+<!-- DEVELOPED BY: DataStream/Government Printing Office -->
+<!-- DEVELOPER: Alia Malhas/Tanya Braginsky -->
+<!-- SEND COMMENTS/QUERIES TO: Kathleen Swiatek(kswiatek@gpo.gov) -->
+<!-- ============================================================= -->
+<!-- CHANGE HISTORY -->
+<!-- Changes incorporated within 1.9 (February 8, 2008) as well
+ as previous changes:
+ 1. Adjusted to allow for tables as created by the new table
+ tool
+ Previos changes:
+ 1. Allowed leader dots display, grayed out the borders,
+ removed horizontal and vertical rules
+ 2. Fixed alignment in last column
+ 3. Adjustment for table width -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- blank lines before/after template -->
+ <xsl:template name="BlankLine">
+ <xsl:param name="cnt"/>
+ <xsl:choose>
+ <xsl:when test="$cnt='0'"> </xsl:when>
+ <xsl:when test="$cnt='1'">
+ <br/>
+ </xsl:when>
+ <xsl:when test="$cnt='2'">
+ <br/>
+ <br/>
+ </xsl:when>
+ <xsl:when test="$cnt='3'">
+ <br/>
+ <br/>
+ <br/>
+ </xsl:when>
+ <xsl:when test="$cnt='4'">
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ </xsl:when>
+ <xsl:when test="$cnt='5'">
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ </xsl:when>
+ <xsl:when test="$cnt='6'">
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ </xsl:when>
+ <xsl:when test="$cnt='7'">
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ <br/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <!-- Indent template -->
+ <xsl:template name="Indent">
+ <xsl:param name="num"/>
+ <xsl:choose>
+ <xsl:when test="$num=2">
+ <xsl:text>  </xsl:text>
+ </xsl:when>
+ <xsl:when test="$num=4">
+ <xsl:text>    </xsl:text>
+ </xsl:when>
+ <xsl:when test="$num=6">
+ <xsl:text>      </xsl:text>
+ </xsl:when>
+ <xsl:when test="$num=8">
+ <xsl:text>        </xsl:text>
+ </xsl:when>
+ <xsl:when test="$num=10">
+ <xsl:text>          </xsl:text>
+ </xsl:when>
+ <xsl:when test="$num=12">
+ <xsl:text>            </xsl:text>
+ </xsl:when>
+ <xsl:when test="$num=14">
+ <xsl:text>              </xsl:text>
+ </xsl:when>
+ <xsl:when test="$num=16">
+ <xsl:text>                </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- border template -->
+ <xsl:template name="border">
+ <xsl:param name="side" select="'left'"/>
+ <xsl:param name="padding" select="0"/>
+ <xsl:param name="style" select="'solid'"/>
+ <xsl:param name="color" select="'#FFFFFF'"/>
+ <xsl:param name="thickness" select="1"/>
+ <!-- Note: Some browsers (mozilla) require at least a width and style. -->
+ <xsl:choose>
+ <xsl:when test="($thickness != '' and $style != '' and $color != '') or ($thickness != '' and $style != '') or ($thickness != '')">
+ <!-- use the compound property if we can: -->
+ <!-- it saves space and probably works more reliably -->
+ <xsl:text>border-</xsl:text>
+ <xsl:value-of select="$side"/>
+ <xsl:text>: </xsl:text>
+ <xsl:value-of select="$thickness"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$style"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$color"/>
+ <xsl:text>; </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- we need to specify the styles individually -->
+ <xsl:if test="$thickness != ''">
+ <xsl:text>border-</xsl:text>
+ <xsl:value-of select="$side"/>
+ <xsl:text>-width: </xsl:text>
+ <xsl:value-of select="$thickness"/>
+ <xsl:text>; </xsl:text>
+ </xsl:if>
+ <xsl:if test="$style != ''">
+ <xsl:text>border-</xsl:text>
+ <xsl:value-of select="$side"/>
+ <xsl:text>-style: </xsl:text>
+ <xsl:value-of select="$style"/>
+ <xsl:text>; </xsl:text>
+ </xsl:if>
+ <xsl:if test="$color != ''">
+ <xsl:text>border-</xsl:text>
+ <xsl:value-of select="$side"/>
+ <xsl:text>-color: </xsl:text>
+ <xsl:value-of select="$color"/>
+ <xsl:text>; </xsl:text>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- column seperator template -->
+ <xsl:template name="ColSep">
+ <xsl:param name="color"/>
+ <xsl:param name="style"/>
+ <xsl:param name="ruleweight"/>
+ <xsl:if test="$style='double'">
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'right'"/>
+ <xsl:with-param name="style" select="$style"/>
+ <xsl:with-param name="color" select="$color"/>
+ <xsl:with-param name="thickness" select="'thick'"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="not($style='double')">
+ <xsl:if test="number(substring-before(substring-after(substring-after(substring-after(substring-after($ruleweight, '.'), '.'), '.'),'.'),'.')) =0">
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'right'"/>
+ <xsl:with-param name="style" select="$style"/>
+ <xsl:with-param name="color" select="'#FFFFFF'"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="'0'"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="number(substring-before(substring-after(substring-after(substring-after(substring-after($ruleweight, '.'), '.'), '.'),'.'),'.')) &gt; 0">
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'right'"/>
+ <xsl:with-param name="style" select="$style"/>
+ <xsl:with-param name="color" select="$color"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="number(substring-before(substring-after(substring-after(substring-after(substring-after($ruleweight, '.'), '.'), '.'),'.'),'.')) div 2"/>px </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- row seperator template -->
+ <xsl:template name="RowSep">
+ <xsl:param name="color"/>
+ <xsl:param name="style"/>
+ <xsl:param name="ruleweight"/>
+ <xsl:if test="$style='double'">
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'bottom'"/>
+ <xsl:with-param name="style" select="$style"/>
+ <xsl:with-param name="color" select="$color"/>
+ <xsl:with-param name="thickness" select="'thick'"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="not($style='double')">
+ <xsl:if test="number(substring-before(substring-after(substring-after(substring-after($ruleweight, '.'), '.'),'.'),'.')) = 0 ">
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'bottom'"/>
+ <xsl:with-param name="style" select="$style"/>
+ <xsl:with-param name="color" select="'#FFFFFF'"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="'0'"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="number(substring-before(substring-after(substring-after(substring-after($ruleweight, '.'), '.'),'.'),'.')) &gt; 0">
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'bottom'"/>
+ <xsl:with-param name="style" select="$style"/>
+ <xsl:with-param name="color" select="$color"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="number(substring-before(substring-after(substring-after(substring-after($ruleweight, '.'), '.'),'.'),'.')) div 2"/>px </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- side template -->
+ <xsl:template name="BorderSides">
+ <xsl:param name="color"/>
+ <xsl:param name="ruleweight"/>
+ <xsl:if test="number(substring-before($ruleweight, '.')) = 0 ">
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'left'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ </xsl:call-template>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'right'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="number(substring-before($ruleweight, '.')) &gt; 0 ">
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'left'"/>
+ <xsl:with-param name="color" select="$color"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="number(substring-before($ruleweight, '.')) div 2"/>px
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'right'"/>
+ <xsl:with-param name="color" select="$color"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="number(substring-before($ruleweight, '.')) div 2"/>px
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="Getleveldiff">
+ <xsl:param name="pnd1"/>
+ <xsl:param name="pnd2"/>
+ <xsl:variable name="tmp1">
+ <xsl:call-template name="LevelNumber">
+ <xsl:with-param name="level" select="$pnd1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="tmp2">
+ <xsl:call-template name="LevelNumber">
+ <xsl:with-param name="level" select="$pnd2"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$tmp1 - $tmp2"/>
+ </xsl:template>
+
+ <xsl:template name="LevelNumber">
+ <xsl:param name="level"/>
+ <xsl:choose>
+ <xsl:when test="$level='section'">
+ <xsl:value-of select="number(8)"/>
+ </xsl:when>
+ <xsl:when test="$level='subsection'">
+ <xsl:value-of select="number(7)"/>
+ </xsl:when>
+ <xsl:when test="$level='paragraph'">
+ <xsl:value-of select="number(6)"/>
+ </xsl:when>
+ <xsl:when test="$level='subparagraph'">
+ <xsl:value-of select="number(5)"/>
+ </xsl:when>
+ <xsl:when test="$level='clause'">
+ <xsl:value-of select="number(4)"/>
+ </xsl:when>
+ <xsl:when test="$level='subclause'">
+ <xsl:value-of select="number(3)"/>
+ </xsl:when>
+ <xsl:when test="$level='item'">
+ <xsl:value-of select="number(2)"/>
+ </xsl:when>
+ <xsl:when test="$level='subitem'">
+ <xsl:value-of select="number(1)"/>
+ </xsl:when>
+ <xsl:when test="$level='table'">
+ <xsl:value-of select="number(9)"/>
+ </xsl:when>
+ <xsl:when test="$level='quoted-block'">
+ <xsl:value-of select="number(9)"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <!-- end of templates -->
+
+ <xsl:decimal-format NaN="0"/>
+
+ <!-- table -->
+ <xsl:template match="table">
+ <xsl:variable name="isFormulaTable">
+ <xsl:choose>
+ <xsl:when test="contains(@table-template-name, 'formula') or contains(@table-template-name, 'Formula')">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="not(name(preceding-sibling::*[1])='table')">
+ <br/>
+ </xsl:if>
+ <xsl:if test="@blank-lines-before">
+ <xsl:call-template name="BlankLine">
+ <xsl:with-param name="cnt" select="./@blank-lines-before"/>
+ </xsl:call-template>
+ </xsl:if>
+ <div id="left" align="center">
+ <xsl:variable name="NegativeIndent">
+ <xsl:choose>
+ <xsl:when test="ancestor::subitem">
+ <xsl:value-of select="6"/>
+ </xsl:when>
+ <xsl:when test="ancestor::item">
+ <xsl:value-of select="6"/>
+ </xsl:when>
+ <xsl:when test="ancestor::subclause">
+ <xsl:value-of select="6"/>
+ </xsl:when>
+ <xsl:when test="ancestor::clause">
+ <xsl:value-of select="6"/>
+ </xsl:when>
+ <xsl:when test="ancestor::subparagraph">
+ <xsl:value-of select="4"/>
+ </xsl:when>
+ <xsl:when test="ancestor::paragraph">
+ <xsl:value-of select="2"/>
+ </xsl:when>
+ <xsl:when test="ancestor::subsection">
+ <xsl:value-of select="2"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="NegativeIndent1">
+ <xsl:if test="ancestor::quoted-block/@style='traditional'">
+ <xsl:value-of select="2"/>
+ </xsl:if>
+ <xsl:if test="not(ancestor::quoted-block/@style='traditional')">
+ <xsl:value-of select="2"/>
+ </xsl:if>
+ </xsl:variable>
+ <!-- TB 30-Jan-2008 Tables on the web improvements -->
+ <!-- According to new Table Tool - align-to -level attribute is not in use -->
+ <!-- in case if it will be returned, we will be able to uncomment the code -->
+ <!--xsl:variable name="NegativeIndent2">
+ <xsl:choose>
+ <xsl:when test="@align-to-level='subitem'">
+ <xsl:value-of select="12"/>
+ </xsl:when>
+ <xsl:when test="@align-to-level='item'">
+ <xsl:value-of select="10"/>
+ </xsl:when>
+ <xsl:when test="@align-to-level='subclause'">
+ <xsl:value-of select="8"/>
+ </xsl:when>
+ <xsl:when test="@align-to-level='clause'">
+ <xsl:value-of select="6"/>
+ </xsl:when>
+ <xsl:when test="@align-to-level='subparagraph'">
+ <xsl:value-of select="4"/>
+ </xsl:when>
+ <xsl:when test="@align-to-level='paragraph'">
+ <xsl:value-of select="2"/>
+ </xsl:when>
+ <xsl:when test="@align-to-level='subsection'">
+ <xsl:value-of select="0"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable-->
+ <xsl:attribute name="style">
+ <xsl:if test="./tgroup/@offset-from-left">
+ <xsl:text>margin-left: </xsl:text>
+ <xsl:value-of select="./tgroup/@offset-from-left"/>
+ <xsl:text>px; </xsl:text>
+ </xsl:if>
+ <xsl:if test="not(./tgroup/@offset-from-left)">
+ <xsl:text>margin-left:</xsl:text>
+ <!-- TB 30-Jan-2008 Tables on the web improvements - changed to be + -->
+ <xsl:value-of select="0 + $NegativeIndent - $NegativeIndent1"/>
+ <xsl:text>em; </xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ <table cellpadding="0" cellspacing="0">
+ <!-- TB 29Dec2008 adjust table width bug #884 -->
+ <xsl:choose>
+ <!-- TB May2009 Adjustment for the formula tables -->
+ <xsl:when test="$isFormulaTable='true'">
+ <xsl:variable name="tableWidth">
+ <xsl:call-template name="calcFormulaTableWidth"/>
+ </xsl:variable>
+ <!--was printing for testing purpose only xsl:value-of select="$tableWidth"/-->
+ <xsl:choose>
+ <xsl:when test="number($tableWidth) &lt; 30">
+ <xsl:attribute name="width">
+ <xsl:text>45%</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="number($tableWidth) &gt;= 30 and number($tableWidth) &lt; 50 ">
+ <xsl:attribute name="width">
+ <xsl:text>50%</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="number($tableWidth) &gt;= 50 and number($tableWidth) &lt; 70">
+ <xsl:attribute name="width">
+ <xsl:text>55%</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="width">
+ <xsl:text>75%</xsl:text>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="width">
+ <xsl:text>95%</xsl:text>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:variable name="topbottom">
+ <xsl:if test="number(substring-before(@rule-weights,'.')) &gt; 0">
+ <xsl:value-of select="'1'"/>
+ </xsl:if>
+ <xsl:if test="number(substring-before(@rule-weights,'.')) = 0">
+ <xsl:value-of select="'0'"/>
+ </xsl:if>
+ <xsl:if test="number(substring-before(substring-after(substring-after(@rule-weights, '.'), '.'), '.')) &gt; 0 ">
+ <xsl:value-of select="'1'"/>
+ </xsl:if>
+ <xsl:if test="number(substring-before(substring-after(substring-after(@rule-weights, '.'), '.'), '.')) = 0 ">
+ <xsl:value-of select="'0'"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="horver">
+ <xsl:if test="number(substring-before(substring-after(substring-after(substring-after(@rule-weights, '.'), '.'), '.'),'.')) &gt; 0 ">
+ <xsl:value-of select="'1'"/>
+ </xsl:if>
+ <xsl:if test="number(substring-before(substring-after(substring-after(substring-after(@rule-weights, '.'), '.'), '.'),'.')) = 0 ">
+ <xsl:value-of select="'0'"/>
+ </xsl:if>
+ <xsl:if test="number(substring-before(substring-after(substring-after(substring-after(substring-after(@rule-weights, '.'), '.'), '.'),'.'),'.')) &gt; 0 ">
+ <xsl:value-of select="'1'"/>
+ </xsl:if>
+ <xsl:if test="number(substring-before(substring-after(substring-after(substring-after(substring-after(@rule-weights, '.'), '.'), '.'),'.'),'.')) = 0 ">
+ <xsl:value-of select="'0'"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:attribute name="class">
+ <xsl:value-of select="@table-type"/>
+ </xsl:attribute>
+ <xsl:attribute name="rules">
+ <xsl:value-of select="'none'"/>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$topbottom='11'">
+ <xsl:attribute name="style">
+ <xsl:text>border-collapse: collapse;</xsl:text>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'top'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="number(substring-before(@rule-weights, '.')) div 2"/>px </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'bottom'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="number(substring-before(substring-after(substring-after(@rule-weights, '.') , '.'),'.')) div 2"/>px </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="BorderSides">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="ruleweight" select="@rule-weights"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$topbottom='10'">
+ <xsl:attribute name="style">
+ <xsl:text>border-collapse: collapse;</xsl:text>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'top'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="number(substring-before(@rule-weights, '.')) div 2"/>px </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'bottom'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ </xsl:call-template>
+ <xsl:call-template name="BorderSides">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="ruleweight" select="@rule-weights"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$topbottom='01'">
+ <xsl:attribute name="style">
+ <xsl:text>border-collapse: collapse;</xsl:text>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'bottom'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ </xsl:call-template>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'top'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="number(substring-before(@rule-weights, '.')) div 2"/>px </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="BorderSides">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="ruleweight" select="@rule-weights"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$topbottom='00'">
+ <xsl:attribute name="style">
+ <xsl:text>border-collapse: collapse;</xsl:text>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'top'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ </xsl:call-template>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'bottom'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ </xsl:call-template>
+ <xsl:call-template name="BorderSides">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="ruleweight" select="@rule-weights"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style">
+ <xsl:text>border-collapse: collapse;</xsl:text>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'top'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="number(substring-before(@rule-weights, '.')) div 2"/>px </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="border">
+ <xsl:with-param name="side" select="'bottom'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="thickness">
+ <xsl:value-of select="number(substring-before(substring-after(substring-after(@rule-weights, '.') , '.'),'.')) div 2"/>px </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="BorderSides">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="ruleweight" select="@rule-weights"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="summary">
+ <xsl:text>Align to level: </xsl:text>
+ <xsl:value-of select="@align-to-level"/>
+ <xsl:text>; Subformat: </xsl:text>
+ <xsl:value-of select="@subformat"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </table>
+ <!-- tfoot -->
+ <xsl:if test="descendant::tfoot">
+ <xsl:apply-templates select=".//tfoot" mode="ppp"/>
+ </xsl:if>
+ </div>
+ <xsl:if test="@blank-lines-after">
+ <xsl:call-template name="BlankLine">
+ <xsl:with-param name="cnt" select="./@blank-lines-after"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <!-- table title -->
+ <xsl:template match="ttitle">
+ <caption align="center" class="ttitle">
+ <xsl:choose>
+ <xsl:when test="parent::table/@ table-template-name = 'Index to bill and report'">
+ <xsl:attribute name="style">
+ <xsl:text>font-size: </xsl:text>
+ <xsl:value-of select="2 * ../tgroup/@ttitle-size"/>
+ <xsl:text>px;</xsl:text>
+ <xsl:text>text-transform:uppercase;</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style">
+ <xsl:text>font-size: </xsl:text>
+ <xsl:value-of select="2 * ../tgroup/@ttitle-size"/>
+ <xsl:text>px</xsl:text>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:if test="name(../..)='quoted-block'">
+ <xsl:if test="string-length(normalize-space(.)) &gt; 0 ">
+ <xsl:text disable-output-escaping="yes">“</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="parent::table/@ table-template-name = 'Index to bill and report'">
+ <br/>
+ </xsl:if>
+ <xsl:apply-templates/>
+
+ <xsl:if test="parent::table/@ table-template-name = 'Index to bill and report'">
+ <br/>
+ <br/>
+ <hr width="60"/>
+ <br/>
+ <br/>
+ </xsl:if>
+ </caption>
+ </xsl:template>
+ <!-- table subtitle -->
+ <xsl:template match="tdesc">
+ <caption align="center" class="tdesc">
+ <xsl:attribute name="style">
+ <xsl:text>font-size: </xsl:text>
+ <xsl:value-of select="2.2 * (../tgroup/@ttitle-size - 2)"/>
+ <xsl:text>px</xsl:text>
+ </xsl:attribute>
+ <xsl:if test="name(../..)='quoted-block'">
+ <xsl:if test="string-length(normalize-space( .)) &gt; 0 and string-length(../ttitle) =0 ">
+ <xsl:text disable-output-escaping="yes">“</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </caption>
+ </xsl:template>
+ <!-- column spec -->
+ <xsl:template match="colspec">
+ <xsl:variable name="TotalLen">
+ <xsl:choose>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 6">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'txt')]/@min-data-value) + sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *3.5"/>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 7">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'txt')]/@min-data-value) + sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *4"/>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 8">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'txt')]/@min-data-value) + sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *4.5"/>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 9">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'txt')]/@min-data-value) + sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *5"/>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 10">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'txt')]/@min-data-value) + sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *6"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'txt')]/@min-data-value) + sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *5"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="TotLength">
+ <xsl:if test="not(number($TotalLen))">
+ <xsl:value-of select="'1'"/>
+ </xsl:if>
+ <xsl:if test="number($TotalLen)">
+ <xsl:value-of select="$TotalLen"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="TotalLenTxt">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'txt')]/@min-data-value)"/>
+ </xsl:variable>
+ <xsl:variable name="TotalLenFig">
+ <xsl:choose>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 6">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *3.5"/>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 7">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *4"/>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 8">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *4.5"/>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 9">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *5"/>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 10">
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *6"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="sum(../colspec[contains(@coldef, 'fig')]/@min-data-value) *5"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <col>
+ <xsl:attribute name="class">
+ <xsl:value-of select="@colname"/>
+ </xsl:attribute>
+ <xsl:if test="contains(@coldef , 'fig')">
+ <xsl:choose>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 6">
+ <xsl:attribute name="width">
+ <xsl:value-of select="round(((@min-data-value * 3.5)))"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 7">
+ <xsl:attribute name="width">
+ <xsl:value-of select="round(((@min-data-value * 4)))"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 8">
+ <xsl:attribute name="width">
+ <xsl:value-of select="round(((@min-data-value * 4.5)))"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 9">
+ <xsl:attribute name="width">
+ <xsl:value-of select="round(((@min-data-value * 5)))"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'), '.')) = 10">
+ <xsl:attribute name="width">
+ <xsl:value-of select="round(((@min-data-value * 6)))"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="width">
+ <xsl:value-of select="round(((@min-data-value * 5)))"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="number(ancestor::table/tgroup/@cols) &gt; 3">
+ <xsl:if test="not(contains(@coldef , 'fig'))">
+ <!--<xsl:attribute name="width"><xsl:value-of select="round((translate(@min-data-value, 'nbp','') div number($TotLength)) * 100)"/>%</xsl:attribute>-->
+ <xsl:attribute name="width">
+ <xsl:value-of select="(number(translate(@min-data-value, 'nbp','')) div number($TotalLenTxt)) * (1180 - $TotalLenFig)"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="number(ancestor::table/tgroup/@cols) = 3">
+ <xsl:if test="not(contains(@coldef , 'fig'))">
+ <!--<xsl:attribute name="width"><xsl:value-of select="round((translate(@min-data-value, 'nbp','') div number($TotLength)) * 100)"/>%</xsl:attribute>-->
+ <xsl:attribute name="width">
+ <xsl:value-of select="(number(translate(@min-data-value, 'nbp','')) div number($TotalLenTxt)) * (1180* 0.6 - $TotalLenFig)"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="number(ancestor::table/tgroup/@cols) &lt; 3">
+ <xsl:if test="not(contains(@coldef , 'fig'))">
+ <!--<xsl:attribute name="width"><xsl:value-of select="round((translate(@min-data-value, 'nbp','') div number($TotLength)) * 100)"/>%</xsl:attribute>-->
+ <xsl:if test="@min-data-value=0 and contains(ancestor::table/@table-type, 'subformat')">
+ <xsl:if test="ancestor::table/@table-type='subformat-2-Tax-Rate'">
+ <xsl:if test="count(preceding-sibling::colspec)=0">
+ <xsl:attribute name="width">50%</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="count(preceding-sibling::colspec)=1">
+ <xsl:attribute name="width">50%</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="not(ancestor::table/@table-type='subformat-2-Tax-Rate')">
+ <xsl:if test="count(preceding-sibling::colspec)=0">
+ <xsl:attribute name="width">85%</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="count(preceding-sibling::colspec)=1">
+ <xsl:attribute name="width">15%</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="not(@min-data-value=0 and contains(ancestor::table/@table-type, 'subformat'))">
+ <xsl:attribute name="width">
+ <xsl:value-of select="(number(translate(@min-data-value, 'nbp','')) div number($TotalLenTxt)) * (1180* 0.4 - $TotalLenFig)"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <xsl:attribute name="align">
+ <xsl:value-of select="@align"/>
+ </xsl:attribute>
+ </col>
+ </xsl:template>
+ <!-- table rows -->
+ <xsl:template match="row">
+ <tr>
+ <xsl:apply-templates/>
+ </tr>
+ </xsl:template>
+ <!-- table head /table body -->
+ <xsl:template match="thead|tbody">
+ <xsl:element name="{name()}">
+ <xsl:attribute name="style">
+ <xsl:choose>
+ <xsl:when test="name()='thead'">
+ <xsl:if test="../@thead-tbody-ldg-size">
+ <xsl:text>font-size: </xsl:text>
+ <xsl:value-of select="1.7* number(substring-before(../@thead-tbody-ldg-size, '.'))"/>
+ <xsl:text>px</xsl:text>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="name()='tbody'">
+ <xsl:if test="../@thead-tbody-ldg-size">
+ <xsl:text>font-size: </xsl:text>
+ <xsl:value-of select="1.7* number(substring-before(substring-after(../@thead-tbody-ldg-size, '.'),'.'))"/>
+ <xsl:text>px</xsl:text>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- skip tfoot -->
+ <xsl:template match="tfoot"> </xsl:template>
+
+ <!-- make up another template table for tfoot -->
+ <xsl:template match="tfoot" mode="ppp">
+ <table cellpadding="0" cellspacing="0">
+ <xsl:apply-templates/>
+ </table>
+ </xsl:template>
+
+ <!-- row of tfoot -->
+ <xsl:template match="tfoot/row">
+ <tr>
+ <xsl:apply-templates/>
+ </tr>
+ </xsl:template>
+ <!-- entry of tfoot -->
+ <xsl:template match="tfoot//entry">
+ <td>
+ <xsl:attribute name="class">
+ <xsl:value-of select="'tfoot'"/>
+ </xsl:attribute>
+ <xsl:attribute name="align">
+ <xsl:value-of select="@align"/>
+ </xsl:attribute>
+ <xsl:if test="@namest and @nameend">
+ <xsl:attribute name="colspan">
+ <xsl:value-of select="number(translate(@nameend, 'col','')) - number(translate(@namest, 'col',''))+1"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@morerows">
+ <xsl:attribute name="rowspan">
+ <xsl:value-of select="@morerows + 1"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style">
+ <xsl:if test="ancestor::tgroup/@bearoff">
+ <xsl:text>padding-left: </xsl:text>
+ <xsl:value-of select="number(ancestor::tgroup/@bearoff) + 5"/>
+ <xsl:text>px; </xsl:text>
+ <xsl:text>padding-right: </xsl:text>
+ <xsl:text>1px; </xsl:text>
+ </xsl:if>
+ <xsl:if test="not(ancestor::tgroup/@bearoff)">
+ <xsl:text>padding-left:5px;padding-right:1px;</xsl:text>
+ </xsl:if>
+ <xsl:if test="ancestor::tgroup/@fnote-size">
+ <xsl:text>font-size: </xsl:text>
+ <xsl:value-of select="ancestor::tgroup/@fnote-size * 2.2"/>
+ <xsl:text>px</xsl:text>
+ </xsl:if>
+ <xsl:if test="not(ancestor::tgroup/@fnote-size)">
+ <xsl:text>font-size: 16px</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </td>
+ </xsl:template>
+
+ <!-- thead entry -->
+ <xsl:template match="//thead//entry">
+ <td>
+ <xsl:attribute name="class">
+ <xsl:value-of select="@colname"/>
+ </xsl:attribute>
+ <!-- no wrap for subformat table headers -->
+ <xsl:if test="@colname='I50' or @colname='I46' or @colname='I47' or @colname='I48'">
+ <xsl:attribute name="NOWRAP"/>
+ </xsl:if>
+ <xsl:attribute name="align">
+ <xsl:value-of select="@align"/>
+ </xsl:attribute>
+ <xsl:if test="@namest and @nameend">
+ <xsl:attribute name="colspan">
+ <xsl:choose>
+ <xsl:when test="contains(@nameend, 'column')">
+ <xsl:value-of select="number(translate(@nameend, 'column','')) - number(translate(@namest, 'column',''))+1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="number(translate(@nameend, 'col','')) - number(translate(@namest, 'col',''))+1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@morerows">
+ <xsl:attribute name="rowspan">
+ <xsl:value-of select="@morerows + 1"/>
+ </xsl:attribute>
+ </xsl:if>
+ <!-- Bottom of thead: inherit from @rule-weights -->
+ <xsl:if test="../@rowsep='1'">
+ <xsl:attribute name="style">
+ <xsl:if test="ancestor::tgroup/@bearoff">
+ <xsl:text>padding-left: </xsl:text>
+ <xsl:value-of select="number(ancestor::tgroup/@bearoff) + 5"/>
+ <xsl:text>px; </xsl:text>
+ <xsl:text>padding-right: </xsl:text>
+ <xsl:text>1px; </xsl:text>
+ </xsl:if>
+ <xsl:if test="not(ancestor::tgroup/@bearoff)">
+ <xsl:text>padding-left:5px;padding-right:1px;</xsl:text>
+ </xsl:if>
+ <xsl:if test="count(../preceding-sibling::row) = 0">
+ <xsl:if test="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) &gt; 0">
+ <xsl:text>border-bottom:</xsl:text><xsl:value-of select="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) div 2"/>px<xsl:text> solid #C0C0C0</xsl:text>
+ </xsl:if>
+ <xsl:if test="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) = 0">
+ <xsl:text>border-bottom-width:0px</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="count(../preceding-sibling::row) &gt; 0">
+ <xsl:text>border-bottom:</xsl:text><xsl:value-of select="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) div 2"/>px<xsl:text> solid #C0C0C0</xsl:text>
+ </xsl:if>
+ <xsl:text>; </xsl:text>
+
+ <xsl:variable name="currColname">
+ <xsl:if test="@colname">
+ <xsl:value-of select="@colname"/>
+ </xsl:if>
+ <xsl:if test="not(@colname)">
+ <xsl:value-of select="@namest"/>
+ </xsl:if>
+ </xsl:variable>
+ <!-- last column, there is no colsep -->
+ <xsl:if test="count(following-sibling::entry) &gt; 0 or (number(translate(@nameend, 'col','')) &lt; ancestor::tgroup/@cols)">
+ <xsl:if test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep='1'">
+ <xsl:choose>
+ <xsl:when test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep-modify='bold'">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep-modify='parallel'">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'double'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(../@rowsep='1') ">
+ <xsl:if test="@rowsep='1'">
+ <xsl:attribute name="style">
+ <xsl:if test="ancestor::tgroup/@bearoff">
+ <xsl:text>padding-left: </xsl:text>
+ <xsl:value-of select="number(ancestor::tgroup/@bearoff) + 5"/>
+ <xsl:text>px; </xsl:text>
+ <xsl:text>padding-right: </xsl:text>
+ <xsl:text>1px; </xsl:text>
+ </xsl:if>
+ <xsl:if test="not(ancestor::tgroup/@bearoff)">
+ <xsl:text>padding-left:5px;padding-right:1px;</xsl:text>
+ </xsl:if>
+ <xsl:if test="count(../preceding-sibling::row) = 0">
+ <xsl:if test="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) &gt; 0">
+ <xsl:text>border-bottom:</xsl:text><xsl:value-of select="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) div 2"/>px<xsl:text> solid #C0C0C0</xsl:text>
+ </xsl:if>
+ <xsl:if test="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) = 0">
+ <!-- surpress rowsep in subformat tables -->
+ <xsl:if test="(starts-with(ancestor::table/@table-type, 'subformat'))">
+ <xsl:text>border-bottom:0px solid #FFFFFF</xsl:text>
+ </xsl:if>
+ <xsl:if test="not(starts-with(ancestor::table/@table-type, 'subformat'))">
+ <!--<xsl:text>border-bottom:thin solid #C0C0C0</xsl:text>-->
+ <xsl:text>border-bottom:0px solid #FFFFFF</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="count(../preceding-sibling::row) &gt; 0">
+ <!-- surpress rowsep in subformat tables -->
+ <xsl:if test="(starts-with(ancestor::table/@table-type, 'subformat'))">
+ <xsl:text>border-bottom:</xsl:text><xsl:value-of select="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) div 2"/>px<xsl:text> solid #FFFFFF</xsl:text>
+ </xsl:if>
+ <xsl:if test="not(starts-with(ancestor::table/@table-type, 'subformat'))">
+ <xsl:text>border-bottom:</xsl:text><xsl:value-of select="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) div 2"/>px<xsl:text> solid #C0C0C0</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:text>; </xsl:text>
+ <xsl:variable name="currColname">
+ <xsl:if test="not(@colname)">
+ <xsl:value-of select="@namest"/>
+ </xsl:if>
+ <xsl:if test="@colname">
+ <xsl:value-of select="@colname"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if test="count(following-sibling::entry) &gt; 0 or (number(translate(@nameend, 'col','')) &lt; ancestor::tgroup/@cols)">
+ <xsl:if test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep='1'">
+ <xsl:choose>
+ <xsl:when test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep-modify='bold'">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep-modify='parallel'">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'double'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep='0' or not(ancestor::tgroup/colspec[@colname=$currColname]/@colsep)">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:if>
+
+ <xsl:if test="@rowsep='0' or not(@rowsep)">
+ <xsl:attribute name="style">
+ <xsl:if test="ancestor::tgroup/@bearoff">
+ <xsl:text>padding-left: </xsl:text>
+ <xsl:value-of select="number(ancestor::tgroup/@bearoff) + 5"/>
+ <xsl:text>px; </xsl:text>
+ <xsl:text>padding-right: </xsl:text>
+ <xsl:text>1px; </xsl:text>
+ </xsl:if>
+ <xsl:if test="not(ancestor::tgroup/@bearoff)">
+ <xsl:text>padding-left:5px;padding-right:1px;</xsl:text>
+ </xsl:if>
+ <xsl:if test="count(../following-sibling::row) = 0">
+ <xsl:if test="ancestor::table/@rule-weights">
+ <xsl:if test="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) &gt; 0">
+ <xsl:text>border-bottom:thin solid #C0C0C0</xsl:text>
+ </xsl:if>
+ <xsl:if test="number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) = 0">
+ <!--<xsl:text>border-bottom:thin solid #C0C0C0</xsl:text>-->
+ <xsl:text>border-bottom:0px solid #FFFFFF</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="not(ancestor::table/@rule-weights)">
+ <!-- surpress rowsep in subformat tables -->
+ <xsl:if test="(starts-with(ancestor::table/@table-type, 'subformat'))">
+ <xsl:text>border-bottom:0px solid #FFFFFF</xsl:text>
+ </xsl:if>
+ <xsl:if test="(starts-with(ancestor::table/@table-type, 'subformat'))">
+ <!--<xsl:text>border-bottom:thin solid #C0C0C0</xsl:text>-->
+ <xsl:text>border-bottom:0px solid #FFFFFF</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="count(../following-sibling::row) &gt; 0 ">
+ <xsl:if test="not(ancestor::table/@rule-weights) or number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) = 0">
+ <!-- surpress rowsep in subformat tables -->
+ <xsl:if test="(starts-with(ancestor::table/@table-type, 'subformat'))">
+ <xsl:text>border-bottom:0px solid #FFFFFF</xsl:text>
+ </xsl:if>
+ <xsl:if test="not(starts-with(ancestor::table/@table-type, 'subformat'))">
+ <!--<xsl:text>border-bottom:thin solid #C0C0C0</xsl:text>-->
+ <xsl:text>border-bottom:0px solid #FFFFFF</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="ancestor::table/@rule-weights and number(substring-before(substring-after(ancestor::table/@rule-weights, '.'), '.')) &gt; 0">
+ <xsl:text>border-bottom:thin solid #C0C0C0</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:text>; </xsl:text>
+ <xsl:variable name="currColname">
+ <xsl:if test="not(@colname)">
+ <xsl:value-of select="@namest"/>
+ </xsl:if>
+ <xsl:if test="@colname">
+ <xsl:value-of select="@colname"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if test="count(following-sibling::entry) &gt; 0 or (number(translate(@nameend, 'col','')) &lt; ancestor::tgroup/@cols)">
+ <xsl:if test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep='1'">
+ <xsl:choose>
+ <xsl:when test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep-modify='bold'">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep-modify='parallel'">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'double'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep='0' or not(ancestor::tgroup/colspec[@colname=$currColname]/@colsep)">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+
+ <xsl:if test="not(starts-with(ancestor::table/@table-type, 'subformat'))">
+ <xsl:if test="count(preceding-sibling::entry) =0">
+ <xsl:if test="count(../preceding-sibling::row) =0">
+ <xsl:if test="ancestor::quoted-block">
+ <xsl:if test="string-length(normalize-space( .)) &gt; 0 and string-length(ancestor::table/ttitle) = 0 and string-length(ancestor::table/tdesc) =0 ">
+ <xsl:text disable-output-escaping="yes">“</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="(starts-with(ancestor::table/@table-type, 'subformat'))">
+ <xsl:if test="count(preceding-sibling::entry) =0">
+ <xsl:if test="count(../preceding-sibling::row) =0">
+ <xsl:if test="ancestor::quoted-block">
+ <xsl:if test="string-length(normalize-space( .)) &gt; 0 and string-length(ancestor::table/ttitle) = 0 and string-length(ancestor::table/tdesc) =0 ">
+ <xsl:text disable-output-escaping="yes">“</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="count(preceding-sibling::entry) =0">
+ <xsl:if test="count(../preceding-sibling::row) =1">
+ <xsl:if test="string-length(../preceding-sibling::row[1]/entry[1]) = 0 ">
+ <xsl:if test="ancestor::quoted-block">
+ <xsl:if test="string-length(normalize-space( .)) &gt; 0 and string-length(ancestor::table/ttitle) = 0 and string-length(ancestor::table/tdesc) =0 ">
+ <xsl:text disable-output-escaping="yes">“</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </td>
+ </xsl:template>
+
+ <!-- regular entry -->
+ <xsl:template match="//tbody//entry">
+ <xsl:variable name="isFirstNonEmptyEntry">
+ <xsl:call-template name="isFirstNonemptyColumn"/>
+ </xsl:variable>
+ <td>
+ <xsl:variable name="currColname">
+ <xsl:if test="@colname">
+ <xsl:value-of select="@colname"/>
+ </xsl:if>
+ <xsl:if test="not(@colname)">
+ <xsl:value-of select="@namest"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:attribute name="class">
+ <xsl:if test="count(preceding-sibling::entry) = 0 ">
+ <xsl:if test="@stub-definition='txt-ldr'">
+ <xsl:if test="count(following-sibling::entry)=0">
+ <xsl:value-of select="@colname"/>
+ </xsl:if>
+ <xsl:if test="count(following-sibling::entry) &gt; 0">
+ <xsl:value-of select="'dot-leader'"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="count(preceding-sibling::entry) &gt; 0 ">
+ <xsl:if test="count(following-sibling::entry) =0">
+ <xsl:if test="contains(ancestor::tgroup/colspec[@colname=$currColname]/@coldef, 'txt')">
+ <xsl:value-of select="@colname"/>
+ </xsl:if>
+ <xsl:if test="not(contains(ancestor::tgroup/colspec[@colname=$currColname]/@coldef, 'txt'))">
+ <xsl:if test="string-length(.) =0">
+ <xsl:if test="contains(ancestor::table/@table-type, 'Duty')">
+ <xsl:value-of select="@colname"/>
+ </xsl:if>
+ <xsl:if test="not(contains(ancestor::table/@table-type, 'Duty'))">
+ <xsl:if test="not(@align='center')">
+ <xsl:value-of select="'dot-leader'"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="count(following-sibling::entry) &gt; 0">
+ <xsl:if test="@leader-modify='force-ldr'">
+ <xsl:value-of select="'dot-leader'"/>
+ </xsl:if>
+ <xsl:if test="not(@leader-modify='force-ldr')">
+ <xsl:value-of select="@colname"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:attribute name="align">
+ <xsl:value-of select="@align"/>
+ </xsl:attribute>
+ <!-- vertical alignment-->
+ <xsl:if test="not(@valign) and not(contains(ancestor::table/@table-type, 'Duty'))">
+ <xsl:attribute name="valign">
+ <xsl:if test="contains(ancestor::tgroup/colspec[@colname=$currColname]/@coldef, 'fig')">
+ <xsl:value-of select="'bottom'"/>
+ </xsl:if>
+ <xsl:if test="contains(ancestor::tgroup/colspec[@colname=$currColname]/@coldef, 'txt')">
+ <xsl:value-of select="'top'"/>
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(@valign) and (contains(ancestor::table/@table-type, 'Duty'))">
+ <xsl:attribute name="valign">
+ <xsl:value-of select="'top'"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@valign">
+ <xsl:attribute name="valign">
+ <xsl:value-of select="@valign"/>
+ </xsl:attribute>
+ </xsl:if>
+
+ <xsl:if test="@namest and @nameend">
+ <xsl:attribute name="colspan">
+ <xsl:value-of select="number(translate(@nameend, 'col','')) - number(translate(@namest, 'col',''))+1"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@morerows">
+ <xsl:attribute name="rowspan">
+ <xsl:value-of select="@morerows + 1"/>
+ </xsl:attribute>
+ </xsl:if>
+ <!-- style attribute -->
+ <xsl:attribute name="style">
+ <xsl:if test="ancestor::tgroup/@bearoff">
+ <xsl:text>padding-left: </xsl:text>
+ <xsl:text>-4px; </xsl:text>
+ <xsl:text>padding-right: </xsl:text>
+ <xsl:text>-4px; </xsl:text>
+ </xsl:if>
+ <!-- colsep -->
+ <xsl:if test="count(following-sibling::entry) &gt; 0 or (number(translate(@nameend, 'col','')) &lt; ancestor::tgroup/@cols)">
+ <xsl:if test="@colsep='1'">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="@colsep='0'">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- inherit from colspec -->
+ <xsl:if test="not(@colsep)">
+ <xsl:if test="count(following-sibling::entry) &gt; 0 or (number(translate(@nameend, 'col','')) &lt; ancestor::tgroup/@cols)">
+ <xsl:if test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep='1'">
+ <xsl:choose>
+ <xsl:when test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep-modify='bold'">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep-modify='parallel'">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'double'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="ancestor::tgroup/colspec[@colname=$currColname]/@colsep='0' or not(ancestor::tgroup/colspec[@colname=$currColname]/@colsep)">
+ <xsl:call-template name="ColSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ <xsl:text>; </xsl:text>
+
+ <!-- rowsep -->
+ <xsl:if test="count(../following-sibling::row) &gt; 0">
+ <xsl:if test="@rowsep='1'">
+ <xsl:choose>
+ <xsl:when test="@rowsep-modify='bold'">
+ <xsl:call-template name="RowSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="@rowsep-modify='double'">
+ <xsl:call-template name="RowSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'double'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="RowSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+
+ <xsl:if test="@rowsep='0'">
+ <xsl:call-template name="RowSep">
+ <!--<xsl:with-param name="color" select="'#C0C0C0'"/>-->
+ <xsl:with-param name="color" select="'#FFFFFF'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="'0.0.0.0.0.0'"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- inherit from row level-->
+ <xsl:if test="not(@rowsep)">
+ <xsl:if test="../@rowsep='1'">
+ <xsl:choose>
+ <xsl:when test="../@rowsep-modify='bold'">
+ <xsl:call-template name="RowSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="../@rowsep-modify='double'">
+ <xsl:call-template name="RowSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'double'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="RowSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+
+ <xsl:if test="(../@rowsep='0') ">
+ <xsl:call-template name="RowSep">
+ <!--<xsl:with-param name="color" select="'#C0C0C0'"/>-->
+ <xsl:with-param name="color" select="'#FFFFFF'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="'0.0.0.0.0.0'"/>
+ </xsl:call-template>
+ </xsl:if>
+
+ <!-- inherit from colspec -->
+ <xsl:if test="not(../@rowsep)">
+ <xsl:if test="ancestor::tgroup/colspec[@colname=$currColname]/@rowsep='1'">
+ <xsl:choose>
+ <xsl:when test="../@rowsep-modify='bold'">
+ <xsl:call-template name="RowSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="../@rowsep-modify='double'">
+ <xsl:call-template name="RowSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'double'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="RowSep">
+ <xsl:with-param name="color" select="'#C0C0C0'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="ancestor::table/@rule-weights"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="ancestor::tgroup/colspec[@colname=$currColname]/@rowsep='0'">
+ <xsl:call-template name="RowSep">
+ <!--<xsl:with-param name="color" select="'#C0C0C0'"/>-->
+ <xsl:with-param name="color" select="'#FFFFFF'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="'0.0.0.0.0.0'"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="not(ancestor::tgroup/colspec[@colname=$currColname]/@rowsep)">
+ <xsl:call-template name="RowSep">
+ <!--<xsl:with-param name="color" select="'#C0C0C0'"/>-->
+ <xsl:with-param name="color" select="'#FFFFFF'"/>
+ <xsl:with-param name="style" select="'solid'"/>
+ <xsl:with-param name="ruleweight" select="'0.0.0.0.0.0'"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:if test="contains(ancestor::table/@table-template-name, 'Formula') and position() = 1">
+ <xsl:attribute name="width">
+ <xsl:text>10%</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ <span>
+ <xsl:attribute name="class">
+ <xsl:text>td</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="style">
+ <xsl:if test="ancestor::tgroup/@bearoff">
+ <xsl:text>padding-left: </xsl:text>
+ <xsl:value-of select="number(ancestor::tgroup/@bearoff) + 5"/>
+ <xsl:text>px; </xsl:text>
+ <xsl:text>padding-right: </xsl:text>
+ <xsl:text>1px; </xsl:text>
+ </xsl:if>
+ <xsl:if test="not(ancestor::tgroup/@bearoff)">
+ <xsl:text>padding-left:5px;padding-right:1px;</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ <!-- indent: &#160 -->
+ <xsl:if test="@entry-modify">
+ <xsl:call-template name="Indent">
+ <xsl:with-param name="num" select="number(substring(@entry-modify, string-length(@entry-modify),1) -1)*2"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="@stub-hierarchy">
+ <xsl:call-template name="Indent">
+ <xsl:with-param name="num" select="(number(@stub-hierarchy)-1)*2"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!--xsl:if test="count(preceding-sibling::entry) =0">
+ <xsl:if test="count(../preceding-sibling::row) =0"-->
+ <!-- TB May 2009 fixing put quotes only for the first non empty column -->
+ <xsl:variable name="isDutyTable">
+ <xsl:choose>
+ <xsl:when test="contains(ancestor::table/@table-template-name, 'Duty')">
+ <xsl:text>yes</xsl:text>
+ </xsl:when>
+ <xsl:when test="contains(ancestor::table/@table-template-name, 'duty')">
+ <xsl:text>yes</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>no</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="ancestor::quoted-block and $isDutyTable='yes' and not(ancestor::table/@table-type='9-Duty-Suspension')">
+ <xsl:if test="count(preceding-sibling::entry) =0">
+ <xsl:if test="count(../preceding-sibling::row) =0">
+ <xsl:if test="string-length(ancestor::table/ttitle) = 0 and string-length(ancestor::table/tdesc) =0 and string-length(ancestor::table/tgroup/thead) =0 ">
+ <xsl:text disable-output-escaping="yes">“</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="ancestor::quoted-block and $isDutyTable='yes' and ancestor::table/@table-type='9-Duty-Suspension'">
+ <xsl:if test="count(preceding-sibling::entry) =1">
+ <xsl:if test="count(../preceding-sibling::row) =0">
+ <xsl:if test="string-length(ancestor::table/ttitle) = 0 and string-length(ancestor::table/tdesc) =0 and string-length(ancestor::table/tgroup/thead) =0 ">
+ <xsl:text disable-output-escaping="yes">“</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="ancestor::quoted-block and $isFirstNonEmptyEntry='yes'">
+ <xsl:if test="string-length(ancestor::table/ttitle) = 0 and string-length(ancestor::table/tdesc) =0 and string-length(ancestor::table/tgroup/thead) =0 ">
+ <xsl:text disable-output-escaping="yes">“</xsl:text>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:apply-templates/>
+ <!-- closing quote -->
+ <xsl:if test="ancestor::quoted-block and ancestor::quoted-block/after-quoted-block">
+ <xsl:variable name="ParentQBNd">
+ <xsl:value-of select="name(ancestor::quoted-block/child::*[1])"/>
+ </xsl:variable>
+ <xsl:variable name="ParentNd">
+ <xsl:value-of select="name(ancestor::table/parent::*[1])"/>
+ </xsl:variable>
+ <xsl:variable name="LvlDiff">
+ <xsl:call-template name="Getleveldiff">
+ <xsl:with-param name="pnd1" select="$ParentQBNd"/>
+ <xsl:with-param name="pnd2" select="$ParentNd"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="afterQBFlag">
+ <xsl:choose>
+ <xsl:when test="$LvlDiff='0'">
+ <xsl:value-of select="2"/>
+ </xsl:when>
+ <xsl:when test="$LvlDiff='1'">
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:if test="name(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block'">
+ <xsl:value-of select="2"/>
+ </xsl:if>
+ <xsl:if test="not(name(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block')">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="$LvlDiff=2">
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:if test="name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block'">
+ <xsl:value-of select="2"/>
+ </xsl:if>
+ <xsl:if test="not(name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block')">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="$LvlDiff=3">
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:if test="name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block'">
+ <xsl:value-of select="2"/>
+ </xsl:if>
+ <xsl:if test="not(name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block')">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="$LvlDiff=4">
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:if test="name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block'">
+ <xsl:value-of select="2"/>
+ </xsl:if>
+ <xsl:if test="not(name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block')">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="$LvlDiff=5">
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:if test="name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block'">
+ <xsl:value-of select="2"/>
+ </xsl:if>
+ <xsl:if test="not(name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block')">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="$LvlDiff=6">
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:if test="name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block'">
+ <xsl:value-of select="2"/>
+ </xsl:if>
+ <xsl:if test="not(name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block')">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="$LvlDiff=7">
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) = 0">
+ <xsl:if test="count(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*) &gt; 0">
+ <xsl:if test="name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block'">
+ <xsl:value-of select="2"/>
+ </xsl:if>
+ <xsl:if test="not(name(ancestor::table/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/parent::*[1]/following-sibling::*[1]) ='after-quoted-block')">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!--<xsl:if test="ancestor::table/following-sibling::after-quoted-block"> -->
+ <!--<xsl:if test="ancestor::quoted-block and ancestor::quoted-block/after-quoted-block">-->
+ <xsl:variable name="singleq">
+ <xsl:if test="$afterQBFlag='2'">
+ <xsl:text>”</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="qbdata">
+ <!--<xsl:value-of select="concat($singleq, ancestor::table/following-sibling::after-quoted-block)"/> -->
+ <xsl:if test="$afterQBFlag='2'">
+ <xsl:value-of select="concat($singleq, ancestor::quoted-block/after-quoted-block)"/>
+ </xsl:if>
+ <!--<xsl:if test="not(name(ancestor::table/following-sibling::*[1])='after-quoted-block' or name(ancestor::subclause/following-sibling::*[1])='after-quoted-block' or name(ancestor::clause/following-sibling::*[1])='after-quoted-block' or name(ancestor::subparagraph/following-sibling::*[1])='after-quoted-block' or name(ancestor::paragraph/following-sibling::*[1])='after-quoted-block' or name(ancestor::subsection/following-sibling::*[1])='after-quoted-block' or name(ancestor::section/following-sibling::*[1])='after-quoted-block')">
+ <xsl:text></xsl:text>
+ </xsl:if>-->
+ </xsl:variable>
+ <xsl:variable name="lastcell">
+ <xsl:for-each select="ancestor::tbody//entry">
+ <!-- TB change 11May2009 change in logic of last sell-->
+ <xsl:variable name="isLastNonEmptyCell">
+ <xsl:call-template name="isLasttNonemptyColumn"/>
+ </xsl:variable>
+ <xsl:if test="$isLastNonEmptyCell='yes'">
+ <xsl:value-of select="substring(.,string-length(.),1)"/>
+ </xsl:if>
+ <!--xsl:if test="position()=last()">
+ <xsl:value-of select="substring(.,string-length(.),1)"/>
+ </xsl:if-->
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="trailSpc">
+ <xsl:if test="$lastcell= '.' or $lastcell=';'">
+ <xsl:value-of select="concat($lastcell, $qbdata)"/>
+ </xsl:if>
+ <xsl:if test="not($lastcell= '.' or $lastcell=';')">
+ <xsl:value-of select="$qbdata"/>
+ </xsl:if>
+ </xsl:variable>
+
+
+ <!-- TB 11May2009 commented logic about last cell - to put wuotes at last NON EMPTY cell -->
+ <xsl:variable name="isFormulaTable">
+ <xsl:choose>
+ <xsl:when test="contains(ancestor::table/@table-template-name, 'formula') or contains(ancestor::table/@table-template-name, 'Formula')">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$isFormulaTable='true'">
+ <xsl:variable name="isLastNonEmptyCell_1">
+ <xsl:call-template name="isLasttNonemptyColumn"/>
+ </xsl:variable>
+ <xsl:if test="$isLastNonEmptyCell_1 = 'yes' ">
+ <xsl:value-of select="$qbdata"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="count(following-sibling::entry) = 0 ">
+ <xsl:if test="count(../following-sibling::row) = 0">
+ <xsl:value-of select="$qbdata"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+
+
+
+ <!--xsl:if test="count(following-sibling::entry) = 0 "-->
+ <!-- TB 29Dec2008 Bug# 884 changed codition -->
+ <!--xsl:if test="count(../following-sibling::row) &gt; 0"-->
+ <!-- white out trailing space -->
+ <!--xsl:if test="count(../following-sibling::row) = 0">
+ <span style="color:#FFFFFF">
+ <xsl:value-of select="normalize-space($trailSpc)"/>
+ </span>
+ </xsl:if-->
+ <!-- last row -->
+ <!-- what testing environment displays is different from browser. maybe count(preceding-sibling) cause the different-->
+ <!--<xsl:if test="count(../preceding-sibling::row) = 0 and count(../following-sibling::row) = 0">-->
+ <!-- commented by TB 29Dec2008 Bug # 884 -->
+ <!--xsl:if test="count(../following-sibling::row) = 0">
+ <xsl:value-of select="$qbdata"/>
+ </xsl:if>
+
+ </xsl:if-->
+ </xsl:if>
+
+ <!--<xsl:if test="not(ancestor::table/following-sibling::after-quoted-block)"> -->
+ <xsl:if test="not(ancestor::quoted-block and ancestor::quoted-block/after-quoted-block)">
+ <xsl:if test="count(following-sibling::entry) = 0 ">
+ <xsl:variable name="lastcell">
+ <xsl:for-each select="ancestor::tbody//entry">
+ <xsl:if test="position()=last()">
+ <xsl:value-of select="substring(.,string-length(.),1)"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:if test="$lastcell = '.' or $lastcell=';' or $lastcell='”'">
+ <xsl:variable name="trailSpc">
+ <xsl:value-of select="$lastcell"/>
+ </xsl:variable>
+ <xsl:if test="count(../following-sibling::row) &gt; 0">
+ <xsl:choose>
+ <xsl:when test="string-length($trailSpc)=1">
+ <xsl:text> </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </span>
+ </td>
+ </xsl:template>
+
+ <xsl:template match="linebreak">
+ <br/>
+ </xsl:template>
+
+ <xsl:template match="//ttitle//processing-instruction()|//tdesc//processing-instruction()|//thead//processing-instruction()">
+ <xsl:text disable-output-escaping="yes"> </xsl:text>
+ </xsl:template>
+ <!-- end of table -->
+
+ <!-- this template will be use for formula tables -->
+ <!-- the quotes must be opened on the first column on the first non empty row -->
+ <!--the suggestion that I am currently in the entry-->
+ <xsl:template name="isFirstNonemptyColumn">
+ <xsl:variable name="isFormulaTable">
+ <xsl:choose>
+ <xsl:when test="contains(ancestor::table/@table-template-name, '