]> granicus.if.org Git - docbook-dsssl/commitdiff
Applied patch from David Green for #1211477, to prevent
authorMichael Smith <xmldoc@users.sourceforge.net>
Wed, 1 Jun 2005 17:10:03 +0000 (17:10 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Wed, 1 Jun 2005 17:10:03 +0000 (17:10 +0000)
StackOverflowError encountered when processing tables with ~700
rows with Xalan. Smoke-tested and didn't see any obvious problems
with the fix, so going ahead and committing it so others can test
with snapshot.

xsl/html/table.xsl

index 00f6503876b1b56a528f68dabc120dba259c3772..51fc48174ab418da5e374f1bb241f0f405cc7f29 100644 (file)
       </xsl:attribute>
     </xsl:if>
 
-    <xsl:apply-templates select="row[1]">
+    <xsl:apply-templates select="row">
       <xsl:with-param name="spans">
         <xsl:call-template name="blank.spans">
           <xsl:with-param name="cols" select="../@cols"/>
 </xsl:template>
 
 <xsl:template match="row">
-  <xsl:param name="spans"/>
+  <xsl:param name="spans">
+    <!-- Doing it this way in attempt to work around StackOverflowError -->
+    <!-- encountered when processing tables with ~700 rows with Xalan. -->
+    <!-- See #1211477. -->
+    <xsl:if test="preceding-sibling::row">
+      <xsl:apply-templates select="(preceding-sibling::row/entry|preceding-sibling::row/entrytbl)[1]" mode="span">
+        <xsl:with-param name="spans" select="$spans"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </xsl:param>
 
   <xsl:variable name="row-height">
     <xsl:if test="processing-instruction('dbhtml')">
     </xsl:apply-templates>
   </tr>
 
-  <xsl:if test="following-sibling::row">
-    <xsl:variable name="nextspans">
-      <xsl:apply-templates select="(entry|entrytbl)[1]" mode="span">
-        <xsl:with-param name="spans" select="$spans"/>
-      </xsl:apply-templates>
-    </xsl:variable>
 
-    <xsl:apply-templates select="following-sibling::row[1]">
-      <xsl:with-param name="spans" select="$nextspans"/>
-    </xsl:apply-templates>
-  </xsl:if>
 </xsl:template>
 
 <xsl:template match="entry|entrytbl" name="entry">