lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] help with orphan-control in xsl-fo


From: Vaclav Slavik
Subject: Re: [lmi] help with orphan-control in xsl-fo
Date: Sun, 17 May 2009 13:46:24 +0200

On Sun, 2009-05-17 at 03:36 +0000, Greg Chicares wrote:
>   In collapsing border model a table does not have padding

Finally, here's a fix for this one; I now have clean FOP output with
both nasd.xsl and reg_d_individual.xsl.

The patch below is unreadable, but the transformation I did was simple:
for every <fo:table> that had any padding attribute, I enclosed it in
<fo:block> and moved padding attribute to it.

For reference, here are the changes as a diff -d -w output:

=== modified file 'reg_d_individual.xsl'
--- reg_d_individual.xsl        revid:address@hidden
+++ reg_d_individual.xsl        2009-05-17 11:38:00 +0000
@@ -598,7 +598,8 @@
     <xsl:param name="logo_only"/>
     <xsl:param name="displaycontractlanguage"/>
     <xsl:param name="displaydisclaimer"/>
-    <fo:table table-layout="fixed" width="100%" padding-after="2.5pt" 
font-weight="bold" font-size="13.0pt" font-family="sans-serif">
+    <fo:block padding-after="2.5pt">
+      <fo:table table-layout="fixed" width="100%" font-weight="bold" 
font-size="13.0pt" font-family="sans-serif">
       <fo:table-column column-width="50mm"/>
       <fo:table-column column-width="90mm"/>
       <fo:table-column column-width="50mm"/>
@@ -618,6 +619,7 @@
         </fo:table-row>
       </fo:table-body>
     </fo:table>
+    </fo:block>
     <fo:block text-align="center" font-size="9pt">
       <xsl:if test="$displaycontractlanguage=1">
         <fo:block padding-top="1em">
@@ -643,7 +645,8 @@
       </xsl:if>
     </fo:block>
 
-    <fo:table table-layout="fixed" width="100%" padding-top="1em">
+    <fo:block padding-top="1em">
+      <fo:table table-layout="fixed" width="100%">
       <fo:table-column column-width="125mm"/>
       <fo:table-column column-width="proportional-column-width(1)"/>
       <fo:table-body>
@@ -731,6 +734,7 @@
         </fo:table-row>
       </fo:table-body>
     </fo:table>
+    </fo:block>
 
     <fo:block text-align="left" font-size="9pt" font-family="sans-serif">
       <xsl:call-template name="print-franchise-and-policynumber"/>
@@ -739,7 +743,8 @@
 
   <xsl:template name="plain-header">
     <xsl:param name="logo_only"/>
-    <fo:table table-layout="fixed" width="100%" padding-after="2.5pt" 
font-weight="bold" font-size="13.0pt" font-family="sans-serif">
+    <fo:block padding-after="2.5pt">
+      <fo:table table-layout="fixed" width="100%" font-weight="bold" 
font-size="13.0pt" font-family="sans-serif">
       <fo:table-column column-width="50mm"/>
       <fo:table-column column-width="90mm"/>
       <fo:table-column column-width="50mm"/>
@@ -759,6 +764,7 @@
         </fo:table-row>
       </fo:table-body>
     </fo:table>
+    </fo:block>
   </xsl:template>
 
   <xsl:template name="irr-guaranteed-illustration-report">

=== modified file 'variable_annuity.xsl'
--- variable_annuity.xsl        revid:address@hidden
+++ variable_annuity.xsl        2009-05-17 11:38:45 +0000
@@ -697,7 +697,8 @@
 
   <xsl:template name="standard-header">
     <xsl:param name="logo_only"/>
-    <fo:table table-layout="fixed" width="100%" padding-after="2.5pt" 
font-weight="bold" font-size="13.0pt" font-family="sans-serif">
+    <fo:block padding-after="2.5pt">
+      <fo:table table-layout="fixed" width="100%" font-weight="bold" 
font-size="13.0pt" font-family="sans-serif">
       <fo:table-column column-width="50mm"/>
       <fo:table-column column-width="90mm"/>
       <fo:table-column column-width="50mm"/>
@@ -717,6 +718,7 @@
         </fo:table-row>
       </fo:table-body>
     </fo:table>
+    </fo:block>
     <xsl:if test="not($logo_only)">
       <fo:block font-weight="bold" font-size="14pt" font-family="sans-serif" 
text-align="center" padding-top="1em">
         <xsl:value-of select="$scalars/PolicyMktgName"/>



And here's the version that doesn't ignore indentation changes -- it's
unreadable, but it has the advantage that it can be applied with
patch(1):


=== modified file 'reg_d_individual.xsl'
--- reg_d_individual.xsl        revid:address@hidden
+++ reg_d_individual.xsl        2009-05-17 11:38:00 +0000
@@ -598,26 +598,28 @@
     <xsl:param name="logo_only"/>
     <xsl:param name="displaycontractlanguage"/>
     <xsl:param name="displaydisclaimer"/>
-    <fo:table table-layout="fixed" width="100%" padding-after="2.5pt" 
font-weight="bold" font-size="13.0pt" font-family="sans-serif">
-      <fo:table-column column-width="50mm"/>
-      <fo:table-column column-width="90mm"/>
-      <fo:table-column column-width="50mm"/>
-      <fo:table-body>
-        <fo:table-row>
-          <fo:table-cell>
-            <fo:block text-align="left">
-              <xsl:call-template name="company-logo"/>
-            </fo:block>
-          </fo:table-cell>
-          <fo:table-cell>
-            <fo:block/>
-          </fo:table-cell>
-          <fo:table-cell>
-            <fo:block/>
-          </fo:table-cell>
-        </fo:table-row>
-      </fo:table-body>
-    </fo:table>
+    <fo:block padding-after="2.5pt">
+      <fo:table table-layout="fixed" width="100%" font-weight="bold" 
font-size="13.0pt" font-family="sans-serif">
+        <fo:table-column column-width="50mm"/>
+        <fo:table-column column-width="90mm"/>
+        <fo:table-column column-width="50mm"/>
+        <fo:table-body>
+          <fo:table-row>
+            <fo:table-cell>
+              <fo:block text-align="left">
+                <xsl:call-template name="company-logo"/>
+              </fo:block>
+            </fo:table-cell>
+            <fo:table-cell>
+              <fo:block/>
+            </fo:table-cell>
+            <fo:table-cell>
+              <fo:block/>
+            </fo:table-cell>
+          </fo:table-row>
+        </fo:table-body>
+      </fo:table>
+    </fo:block>
     <fo:block text-align="center" font-size="9pt">
       <xsl:if test="$displaycontractlanguage=1">
         <fo:block padding-top="1em">
@@ -643,94 +645,96 @@
       </xsl:if>
     </fo:block>
 
-    <fo:table table-layout="fixed" width="100%" padding-top="1em">
-      <fo:table-column column-width="125mm"/>
-      <fo:table-column column-width="proportional-column-width(1)"/>
-      <fo:table-body>
-        <fo:table-row>
-          <fo:table-cell padding-right="2mm">
-            <fo:block text-align="left" font-size="9pt">
-              <fo:block>
-                Date Prepared: <xsl:call-template name="date-prepared"/>
-              </fo:block>
-              <fo:block>
-                <xsl:choose>
-                  <xsl:when test="$is_composite">
-                    Composite of individuals
-                  </xsl:when>
-                  <xsl:otherwise>
-                    Prepared for:
-                    <xsl:call-template name="limitstring">
-                      <xsl:with-param name="passString" 
select="$scalars/Insured1"/>
-                      <xsl:with-param name="length" select="30"/>
-                    </xsl:call-template>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </fo:block>
-              <xsl:if test="not($is_composite)">
+    <fo:block padding-top="1em">
+      <fo:table table-layout="fixed" width="100%">
+        <fo:table-column column-width="125mm"/>
+        <fo:table-column column-width="proportional-column-width(1)"/>
+        <fo:table-body>
+          <fo:table-row>
+            <fo:table-cell padding-right="2mm">
+              <fo:block text-align="left" font-size="9pt">
                 <fo:block>
-                  Gender: <xsl:value-of select="$scalars/Gender"/>
+                  Date Prepared: <xsl:call-template name="date-prepared"/>
                 </fo:block>
-              </xsl:if>
-              <xsl:if test="not($is_composite)">
                 <fo:block>
-                  Age: <xsl:value-of select="$scalars/Age"/>
-                </fo:block>
-              </xsl:if>
-              <fo:block>
-                Selected Face Amount:
-                $<xsl:value-of select="$scalars/InitTotalSA"/>
-              </fo:block>
-              <fo:block>
-                Initial Death Benefit Option:
-                <xsl:value-of select="$scalars/DBOptInitInteger+1"/>
-              </fo:block>
-            </fo:block>
-          </fo:table-cell>
-
-          <fo:table-cell>
-            <fo:block text-align="left" font-size="9pt">
-              <fo:block>
-                Policy: <xsl:value-of select="$scalars/PolicyMktgName"/>
-                <xsl:value-of select="$registered-symbol"/>
-              </fo:block>
-              <fo:block/>
-              <xsl:if test="not($is_composite)">
-                <fo:block>
-                  Underwriting Type:
                   <xsl:choose>
-                    <xsl:when test="$scalars/UWType='Medical'">
-                      Fully underwritten
+                    <xsl:when test="$is_composite">
+                      Composite of individuals
                     </xsl:when>
                     <xsl:otherwise>
-                      <xsl:value-of select="$scalars/UWType"/>
+                      Prepared for:
+                      <xsl:call-template name="limitstring">
+                        <xsl:with-param name="passString" 
select="$scalars/Insured1"/>
+                        <xsl:with-param name="length" select="30"/>
+                      </xsl:call-template>
                     </xsl:otherwise>
                   </xsl:choose>
                 </fo:block>
+                <xsl:if test="not($is_composite)">
+                  <fo:block>
+                    Gender: <xsl:value-of select="$scalars/Gender"/>
+                  </fo:block>
+                </xsl:if>
+                <xsl:if test="not($is_composite)">
+                  <fo:block>
+                    Age: <xsl:value-of select="$scalars/Age"/>
+                  </fo:block>
+                </xsl:if>
+                <fo:block>
+                  Selected Face Amount:
+                  $<xsl:value-of select="$scalars/InitTotalSA"/>
+                </fo:block>
                 <fo:block>
-                  Rate Classification: <xsl:value-of 
select="$scalars/Gender"/>,
-                  <xsl:value-of select="$scalars/Smoker"/>,
-                  <xsl:value-of select="$scalars/UWClass"/>
+                  Initial Death Benefit Option:
+                  <xsl:value-of select="$scalars/DBOptInitInteger+1"/>
                 </fo:block>
-                <xsl:if test="$scalars/UWClass='Rated'">
-                  <fo:block padding-left="3em">
-                    <fo:block>
-                      Table Rating:
-                      <xsl:value-of select="$scalars/SubstandardTable"/>
-                    </fo:block>
-                    <fo:block>
-                      Initial Annual Flat Extra:
-                      <xsl:value-of 
select="address@hidden'MonthlyFlatExtra']/duration[1]/@column_value"/>
-                      per 1,000
-                    </fo:block>
+              </fo:block>
+            </fo:table-cell>
+
+            <fo:table-cell>
+              <fo:block text-align="left" font-size="9pt">
+                <fo:block>
+                  Policy: <xsl:value-of select="$scalars/PolicyMktgName"/>
+                  <xsl:value-of select="$registered-symbol"/>
+                </fo:block>
+                <fo:block/>
+                <xsl:if test="not($is_composite)">
+                  <fo:block>
+                    Underwriting Type:
+                    <xsl:choose>
+                      <xsl:when test="$scalars/UWType='Medical'">
+                        Fully underwritten
+                      </xsl:when>
+                      <xsl:otherwise>
+                        <xsl:value-of select="$scalars/UWType"/>
+                      </xsl:otherwise>
+                    </xsl:choose>
                   </fo:block>
+                  <fo:block>
+                    Rate Classification: <xsl:value-of 
select="$scalars/Gender"/>,
+                    <xsl:value-of select="$scalars/Smoker"/>,
+                    <xsl:value-of select="$scalars/UWClass"/>
+                  </fo:block>
+                  <xsl:if test="$scalars/UWClass='Rated'">
+                    <fo:block padding-left="3em">
+                      <fo:block>
+                        Table Rating:
+                        <xsl:value-of select="$scalars/SubstandardTable"/>
+                      </fo:block>
+                      <fo:block>
+                        Initial Annual Flat Extra:
+                        <xsl:value-of 
select="address@hidden'MonthlyFlatExtra']/duration[1]/@column_value"/>
+                        per 1,000
+                      </fo:block>
+                    </fo:block>
+                  </xsl:if>
                 </xsl:if>
-              </xsl:if>
-            </fo:block>
-          </fo:table-cell>
-        </fo:table-row>
-      </fo:table-body>
-    </fo:table>
+              </fo:block>
+            </fo:table-cell>
+          </fo:table-row>
+        </fo:table-body>
+      </fo:table>
+    </fo:block>
 
     <fo:block text-align="left" font-size="9pt" font-family="sans-serif">
       <xsl:call-template name="print-franchise-and-policynumber"/>
@@ -739,26 +743,28 @@
 
   <xsl:template name="plain-header">
     <xsl:param name="logo_only"/>
-    <fo:table table-layout="fixed" width="100%" padding-after="2.5pt" 
font-weight="bold" font-size="13.0pt" font-family="sans-serif">
-      <fo:table-column column-width="50mm"/>
-      <fo:table-column column-width="90mm"/>
-      <fo:table-column column-width="50mm"/>
-      <fo:table-body>
-        <fo:table-row>
-          <fo:table-cell>
-            <fo:block text-align="left">
-              <xsl:call-template name="company-logo"/>
-            </fo:block>
-          </fo:table-cell>
-          <fo:table-cell>
-            <fo:block/>
-          </fo:table-cell>
-          <fo:table-cell>
-            <fo:block/>
-          </fo:table-cell>
-        </fo:table-row>
-      </fo:table-body>
-    </fo:table>
+    <fo:block padding-after="2.5pt">
+      <fo:table table-layout="fixed" width="100%" font-weight="bold" 
font-size="13.0pt" font-family="sans-serif">
+        <fo:table-column column-width="50mm"/>
+        <fo:table-column column-width="90mm"/>
+        <fo:table-column column-width="50mm"/>
+        <fo:table-body>
+          <fo:table-row>
+            <fo:table-cell>
+              <fo:block text-align="left">
+                <xsl:call-template name="company-logo"/>
+              </fo:block>
+            </fo:table-cell>
+            <fo:table-cell>
+              <fo:block/>
+            </fo:table-cell>
+            <fo:table-cell>
+              <fo:block/>
+            </fo:table-cell>
+          </fo:table-row>
+        </fo:table-body>
+      </fo:table>
+    </fo:block>
   </xsl:template>
 
   <xsl:template name="irr-guaranteed-illustration-report">

=== modified file 'variable_annuity.xsl'
--- variable_annuity.xsl        revid:address@hidden
+++ variable_annuity.xsl        2009-05-17 11:38:45 +0000
@@ -697,26 +697,28 @@
 
   <xsl:template name="standard-header">
     <xsl:param name="logo_only"/>
-    <fo:table table-layout="fixed" width="100%" padding-after="2.5pt" 
font-weight="bold" font-size="13.0pt" font-family="sans-serif">
-      <fo:table-column column-width="50mm"/>
-      <fo:table-column column-width="90mm"/>
-      <fo:table-column column-width="50mm"/>
-      <fo:table-body>
-        <fo:table-row>
-          <fo:table-cell>
-            <fo:block text-align="left">
-              <xsl:call-template name="company-logo"/>
-            </fo:block>
-          </fo:table-cell>
-          <fo:table-cell>
-            <fo:block/>
-          </fo:table-cell>
-          <fo:table-cell>
-            <fo:block/>
-          </fo:table-cell>
-        </fo:table-row>
-      </fo:table-body>
-    </fo:table>
+    <fo:block padding-after="2.5pt">
+      <fo:table table-layout="fixed" width="100%" font-weight="bold" 
font-size="13.0pt" font-family="sans-serif">
+        <fo:table-column column-width="50mm"/>
+        <fo:table-column column-width="90mm"/>
+        <fo:table-column column-width="50mm"/>
+        <fo:table-body>
+          <fo:table-row>
+            <fo:table-cell>
+              <fo:block text-align="left">
+                <xsl:call-template name="company-logo"/>
+              </fo:block>
+            </fo:table-cell>
+            <fo:table-cell>
+              <fo:block/>
+            </fo:table-cell>
+            <fo:table-cell>
+              <fo:block/>
+            </fo:table-cell>
+          </fo:table-row>
+        </fo:table-body>
+      </fo:table>
+    </fo:block>
     <xsl:if test="not($logo_only)">
       <fo:block font-weight="bold" font-size="14pt" font-family="sans-serif" 
text-align="center" padding-top="1em">
         <xsl:value-of select="$scalars/PolicyMktgName"/>







reply via email to

[Prev in Thread] Current Thread [Next in Thread]