]> granicus.if.org Git - docbook-dsssl/commitdiff
Support rows that are *completely* overlapped by the preceding row
authorNorman Walsh <ndw@nwalsh.com>
Thu, 31 Aug 2006 16:29:49 +0000 (16:29 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 31 Aug 2006 16:29:49 +0000 (16:29 +0000)
xsl/common/table.xsl
xsl/fo/table.xsl
xsl/html/table.xsl

index 4032543b99a8007549f2c8916333bb38a6cd257e..c70267d519368717258b4edad19e409565b4b8b1 100644 (file)
@@ -461,4 +461,16 @@ or 0 (the empty string)</para>
   </xsl:for-each>
 </xsl:template>
 
+<xsl:template name="consume-row">
+  <xsl:param name="spans"/>
+
+  <xsl:if test="contains($spans,':')">
+    <xsl:value-of select="substring-before($spans,':') - 1"/>
+    <xsl:text>:</xsl:text>
+    <xsl:call-template name="consume-row">
+      <xsl:with-param name="spans" select="substring-after($spans,':')"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
 </xsl:stylesheet>
index 26dcbd0109beab26e485a4e2834f7efc0c862fcf..ccc497a8e8fd2a70da7e1abb02fa809b24767c3f 100644 (file)
@@ -684,6 +684,46 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 <xsl:template match="row">
   <xsl:param name="spans"/>
 
+  <xsl:choose>
+    <xsl:when test="contains($spans, '0')">
+      <xsl:call-template name="normal-row">
+       <xsl:with-param name="spans" select="$spans"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <!--
+      <xsl:message>
+       <xsl:text>Ignoring row: </xsl:text>
+       <xsl:value-of select="$spans"/>
+       <xsl:text> = </xsl:text>
+       <xsl:call-template name="consume-row">
+         <xsl:with-param name="spans" select="$spans"/>
+       </xsl:call-template>
+      </xsl:message>
+      -->
+
+      <xsl:if test="normalize-space(.//text()) != ''">
+       <xsl:message>Warning: overlapped row contains content!</xsl:message>
+      </xsl:if>
+
+      <fo:table-row>
+       <xsl:comment> This row intentionally left blank </xsl:comment>
+      </fo:table-row>
+
+      <xsl:apply-templates select="following-sibling::row[1]">
+       <xsl:with-param name="spans">
+         <xsl:call-template name="consume-row">
+           <xsl:with-param name="spans" select="$spans"/>
+         </xsl:call-template>
+       </xsl:with-param>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="normal-row">
+  <xsl:param name="spans"/>
+
   <xsl:variable name="bgcolor">
     <xsl:call-template name="dbfo-attribute">
       <xsl:with-param name="pis" select="processing-instruction('dbfo')"/>
index 18c344fed0855901fb54d77aa3f4ea23c21df438..a11ffe028e2a1a461d5f62e51a0e21fc4d13f9f2 100644 (file)
 <xsl:template match="row">
   <xsl:param name="spans"/>
 
+  <xsl:choose>
+    <xsl:when test="contains($spans, '0')">
+      <xsl:call-template name="normal-row">
+       <xsl:with-param name="spans" select="$spans"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <!--
+      <xsl:message>
+       <xsl:text>Ignoring row: </xsl:text>
+       <xsl:value-of select="$spans"/>
+       <xsl:text> = </xsl:text>
+       <xsl:call-template name="consume-row">
+         <xsl:with-param name="spans" select="$spans"/>
+       </xsl:call-template>
+      </xsl:message>
+      -->
+
+      <xsl:if test="normalize-space(.//text()) != ''">
+       <xsl:message>Warning: overlapped row contains content!</xsl:message>
+      </xsl:if>
+
+      <tr><xsl:comment> This row intentionally left blank </xsl:comment></tr>
+
+      <xsl:apply-templates select="following-sibling::row[1]">
+       <xsl:with-param name="spans">
+         <xsl:call-template name="consume-row">
+           <xsl:with-param name="spans" select="$spans"/>
+         </xsl:call-template>
+       </xsl:with-param>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="normal-row">
+  <xsl:param name="spans"/>
+
   <xsl:variable name="row-height">
     <xsl:if test="processing-instruction('dbhtml')">
       <xsl:call-template name="dbhtml-attribute">