]> granicus.if.org Git - docbook-dsssl/commitdiff
Table updates
authorNorman Walsh <ndw@nwalsh.com>
Sat, 3 Nov 2001 23:03:38 +0000 (23:03 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sat, 3 Nov 2001 23:03:38 +0000 (23:03 +0000)
xsl/fo/formal.xsl
xsl/fo/table.xsl

index c307de56ad1f468a8025cc4b5d760e4e49d00c5c..ecab312db7938535e1a2d7ff33c1589279ee72b4 100644 (file)
   <xsl:variable name="prop-columns"
     select=".//colspec[contains(@colwidth, '*')]"/>
 
-  <fo:table-and-caption id="{$id}"
-                        xsl:use-attribute-sets="formal.object.properties"
-                        keep-together.within-column="1">
-    <fo:table-caption>
-      <fo:block xsl:use-attribute-sets="formal.title.properties">
-        <xsl:apply-templates select="." mode="object.title.markup"/>
-      </fo:block>
-    </fo:table-caption>
-    <fo:table>
-      <xsl:if test="count($prop-columns) != 0">
-       <xsl:attribute name="table-layout">fixed</xsl:attribute>
-      </xsl:if>
-      <xsl:apply-templates/>
-    </fo:table>
-  </fo:table-and-caption>
+  <fo:block>
+    <xsl:attribute name="span">
+      <xsl:choose>
+        <xsl:when test="@pgwide=1">all</xsl:when>
+        <xsl:otherwise>none</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+
+    <fo:table-and-caption id="{$id}"
+                          xsl:use-attribute-sets="formal.object.properties"
+                          keep-together.within-column="1">
+      <fo:table-caption>
+        <fo:block xsl:use-attribute-sets="formal.title.properties">
+          <xsl:apply-templates select="." mode="object.title.markup"/>
+        </fo:block>
+      </fo:table-caption>
+      <fo:table>
+        <xsl:variable name="frame">
+          <xsl:choose>
+            <xsl:when test="@frame">
+              <xsl:value-of select="@frame"/>
+            </xsl:when>
+            <xsl:otherwise>all</xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
+        <xsl:choose>
+          <xsl:when test="$frame='all'">
+            <xsl:attribute name="border-left-style">solid</xsl:attribute>
+            <xsl:attribute name="border-right-style">solid</xsl:attribute>
+            <xsl:attribute name="border-top-style">solid</xsl:attribute>
+            <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
+          </xsl:when>
+          <xsl:when test="$frame='bottom'">
+            <xsl:attribute name="border-left-style">none</xsl:attribute>
+            <xsl:attribute name="border-right-style">none</xsl:attribute>
+            <xsl:attribute name="border-top-style">none</xsl:attribute>
+            <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
+          </xsl:when>
+          <xsl:when test="$frame='sides'">
+            <xsl:attribute name="border-left-style">solid</xsl:attribute>
+            <xsl:attribute name="border-right-style">solid</xsl:attribute>
+            <xsl:attribute name="border-top-style">none</xsl:attribute>
+            <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+          </xsl:when>
+          <xsl:when test="$frame='top'">
+            <xsl:attribute name="border-left-style">none</xsl:attribute>
+            <xsl:attribute name="border-right-style">none</xsl:attribute>
+            <xsl:attribute name="border-top-style">solid</xsl:attribute>
+            <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+          </xsl:when>
+          <xsl:when test="$frame='topbot'">
+            <xsl:attribute name="border-left-style">none</xsl:attribute>
+            <xsl:attribute name="border-right-style">none</xsl:attribute>
+            <xsl:attribute name="border-top-style">solid</xsl:attribute>
+            <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:message>
+              <xsl:text>Impossible frame on table: </xsl:text>
+              <xsl:value-of select="$frame"/>
+            </xsl:message>
+            <xsl:attribute name="border-left-style">none</xsl:attribute>
+            <xsl:attribute name="border-right-style">none</xsl:attribute>
+            <xsl:attribute name="border-top-style">none</xsl:attribute>
+            <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+          </xsl:otherwise>
+        </xsl:choose>
+
+        <xsl:if test="count($prop-columns) != 0">
+          <xsl:attribute name="table-layout">fixed</xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates/>
+      </fo:table>
+    </fo:table-and-caption>
+  </fo:block>
 </xsl:template>
 
 <xsl:template match="equation">
   <xsl:variable name="prop-columns"
     select=".//colspec[contains(@colwidth, '*')]"/>
 
-  <fo:table>
-    <xsl:if test="count($prop-columns) != 0">
-      <xsl:attribute name="table-layout">fixed</xsl:attribute>
-    </xsl:if>
-    <xsl:apply-templates/>
-  </fo:table>
+  <fo:block>
+    <xsl:attribute name="span">
+      <xsl:choose>
+        <xsl:when test="@pgwide=1">all</xsl:when>
+        <xsl:otherwise>none</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+
+    <fo:table>
+      <xsl:variable name="frame">
+        <xsl:choose>
+          <xsl:when test="@frame">
+            <xsl:value-of select="@frame"/>
+          </xsl:when>
+          <xsl:otherwise>all</xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="$frame='all'">
+          <xsl:attribute name="border-left-style">solid</xsl:attribute>
+          <xsl:attribute name="border-right-style">solid</xsl:attribute>
+          <xsl:attribute name="border-top-style">solid</xsl:attribute>
+          <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
+        </xsl:when>
+        <xsl:when test="$frame='bottom'">
+          <xsl:attribute name="border-left-style">none</xsl:attribute>
+          <xsl:attribute name="border-right-style">none</xsl:attribute>
+          <xsl:attribute name="border-top-style">none</xsl:attribute>
+          <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
+        </xsl:when>
+        <xsl:when test="$frame='sides'">
+          <xsl:attribute name="border-left-style">solid</xsl:attribute>
+          <xsl:attribute name="border-right-style">solid</xsl:attribute>
+          <xsl:attribute name="border-top-style">none</xsl:attribute>
+          <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+        </xsl:when>
+        <xsl:when test="$frame='top'">
+          <xsl:attribute name="border-left-style">none</xsl:attribute>
+          <xsl:attribute name="border-right-style">none</xsl:attribute>
+          <xsl:attribute name="border-top-style">solid</xsl:attribute>
+          <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+        </xsl:when>
+        <xsl:when test="$frame='topbot'">
+          <xsl:attribute name="border-left-style">none</xsl:attribute>
+          <xsl:attribute name="border-right-style">none</xsl:attribute>
+          <xsl:attribute name="border-top-style">solid</xsl:attribute>
+          <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>Impossible frame on informaltable: </xsl:text>
+            <xsl:value-of select="$frame"/>
+          </xsl:message>
+          <xsl:attribute name="border-left-style">none</xsl:attribute>
+          <xsl:attribute name="border-right-style">none</xsl:attribute>
+          <xsl:attribute name="border-top-style">none</xsl:attribute>
+          <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+        </xsl:otherwise>
+      </xsl:choose>
+
+      <xsl:if test="count($prop-columns) != 0">
+        <xsl:attribute name="table-layout">fixed</xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </fo:table>
+  </fo:block>
 </xsl:template>
 
 <xsl:template match="informalequation">
index a6625289303b4848867345eec004e1836ead06a2..67ae62948cc59b6210bb325e5670cd272918395f 100644 (file)
@@ -86,9 +86,7 @@ to be incomplete. Don't forget to read the source, too :-)</para>
         <xsl:with-param name="padding" select="1"/>
       </xsl:call-template>
     </xsl:if>
-    <!-- don't draw a rowsep on this cell if this row already has one -->
-    <xsl:if test="$rowsep &gt; 0
-                  and ancestor::row[1]/@rowsep != 1">
+    <xsl:if test="$rowsep &gt; 0">
       <xsl:call-template name="border">
         <xsl:with-param name="side" select="'bottom'"/>
         <xsl:with-param name="padding" select="1"/>
@@ -204,25 +202,8 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 
 <xsl:template match="thead">
   <xsl:variable name="tgroup" select="parent::*"/>
-  <xsl:variable name="frame" select="$tgroup/parent::*/@frame"/>
 
   <fo:table-header>
-    <xsl:choose>
-      <xsl:when test="$frame='topbot' or $frame='top'">
-        <xsl:call-template name="border">
-          <xsl:with-param name="side" select="'top'"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="$frame='sides'">
-        <xsl:call-template name="border">
-          <xsl:with-param name="side" select="'left'"/>
-        </xsl:call-template>
-        <xsl:call-template name="border">
-          <xsl:with-param name="side" select="'right'"/>
-        </xsl:call-template>
-      </xsl:when>
-    </xsl:choose>
-
     <xsl:apply-templates select="row[1]">
       <xsl:with-param name="spans">
         <xsl:call-template name="blank.spans">
@@ -236,25 +217,8 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 
 <xsl:template match="tfoot">
   <xsl:variable name="tgroup" select="parent::*"/>
-  <xsl:variable name="frame" select="$tgroup/parent::*/@frame"/>
 
   <fo:table-footer>
-    <xsl:choose>
-      <xsl:when test="$frame='topbot' or $frame='top'">
-        <xsl:call-template name="border">
-          <xsl:with-param name="side" select="'top'"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:when test="$frame='sides'">
-        <xsl:call-template name="border">
-          <xsl:with-param name="side" select="'left'"/>
-        </xsl:call-template>
-        <xsl:call-template name="border">
-          <xsl:with-param name="side" select="'right'"/>
-        </xsl:call-template>
-      </xsl:when>
-    </xsl:choose>
-
     <xsl:apply-templates select="row[1]">
       <xsl:with-param name="spans">
         <xsl:call-template name="blank.spans">
@@ -268,61 +232,8 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 
 <xsl:template match="tbody">
   <xsl:variable name="tgroup" select="parent::*"/>
-  <xsl:variable name="frame" select="$tgroup/parent::*/@frame"/>
-  <fo:table-body>
-    <xsl:choose>
-      <xsl:when test="$frame='top'">
-        <xsl:choose>
-          <xsl:when test="preceding-sibling::thead">
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:call-template name="border">
-              <xsl:with-param name="side" select="'top'"/>
-            </xsl:call-template>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="$frame='bottom'">
-        <xsl:choose>
-          <xsl:when test="preceding-sibling::tfoot">
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:call-template name="border">
-              <xsl:with-param name="side" select="'bottom'"/>
-            </xsl:call-template>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="$frame='topbot'">
-        <xsl:choose>
-          <xsl:when test="preceding-sibling::thead">
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:call-template name="border">
-              <xsl:with-param name="side" select="'top'"/>
-            </xsl:call-template>
-          </xsl:otherwise>
-        </xsl:choose>
-        <xsl:choose>
-          <xsl:when test="preceding-sibling::tfoot">
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:call-template name="border">
-              <xsl:with-param name="side" select="'bottom'"/>
-            </xsl:call-template>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="$frame='sides'">
-        <xsl:call-template name="border">
-          <xsl:with-param name="side" select="'left'"/>
-        </xsl:call-template>
-        <xsl:call-template name="border">
-          <xsl:with-param name="side" select="'right'"/>
-        </xsl:call-template>
-      </xsl:when>
-    </xsl:choose>
 
+  <fo:table-body>
     <xsl:apply-templates select="row[1]">
       <xsl:with-param name="spans">
         <xsl:call-template name="blank.spans">
@@ -340,12 +251,6 @@ to be incomplete. Don't forget to read the source, too :-)</para>
   <fo:table-row>
     <xsl:call-template name="anchor"/>
 
-    <xsl:if test="@rowsep='1'">
-      <xsl:call-template name="border">
-        <xsl:with-param name="side" select="'bottom'"/>
-      </xsl:call-template>
-    </xsl:if>
-
     <xsl:apply-templates select="entry[1]">
       <xsl:with-param name="spans" select="$spans"/>
     </xsl:apply-templates>
@@ -477,18 +382,10 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 
         <xsl:choose>
           <xsl:when test="$frame='all'">
-            <xsl:call-template name="border">
-              <xsl:with-param name="side" select="'left'"/>
-              <xsl:with-param name="padding" select="1"/>
-            </xsl:call-template>
             <xsl:call-template name="border">
               <xsl:with-param name="side" select="'right'"/>
               <xsl:with-param name="padding" select="1"/>
             </xsl:call-template>
-            <xsl:call-template name="border">
-              <xsl:with-param name="side" select="'top'"/>
-              <xsl:with-param name="padding" select="1"/>
-            </xsl:call-template>
             <xsl:call-template name="border">
               <xsl:with-param name="side" select="'bottom'"/>
               <xsl:with-param name="padding" select="1"/>
@@ -501,9 +398,7 @@ to be incomplete. Don't forget to read the source, too :-)</para>
                 <xsl:with-param name="padding" select="1"/>
               </xsl:call-template>
             </xsl:if>
-            <!-- don't draw a rowsep on this cell if this row has one -->
-            <xsl:if test="$rowsep &gt; 0
-                          and ancestor::row[1]/@rowsep != 1">
+            <xsl:if test="$rowsep &gt; 0">
               <xsl:call-template name="border">
                 <xsl:with-param name="side" select="'bottom'"/>
                 <xsl:with-param name="padding" select="1"/>