MPPDF-54: Identical ids in tables in different documents caused a build failure

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@332923 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl 2005-11-13 07:09:08 +00:00
parent ea19d8a402
commit 76ca1f8a39
2 changed files with 59 additions and 13 deletions

View File

@ -21,6 +21,7 @@
<!-- Table rendering -->
<!-- Generation for tables with THEAD and TBODY -->
<xsl:template match="table" name="find-max-columns">
<xsl:param name="fileName"/>
<!-- Before we do anything, we need to scan the table to find the maximum span -->
<xsl:param name="row">1</xsl:param>
<xsl:param name="maxColumns">1</xsl:param>
@ -49,16 +50,19 @@
<xsl:call-template name="find-max-columns">
<xsl:with-param name="row" select="$row+1"/>
<xsl:with-param name="maxColumns" select="$newMaxColumns"/>
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="print-table">
<xsl:with-param name="spacerSpanColumns" select="$newMaxColumns"/>
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="print-table">
<xsl:param name="fileName"/>
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:comment> :::::: New table :::::: </xsl:comment>
<fo:block xsl:use-attribute-sets="table.padding">
@ -83,6 +87,7 @@
<!-- Process any thead elements -->
<xsl:apply-templates select="thead">
<xsl:with-param name="spacerSpanColumns" select="$spacerSpanColumns"/>
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
</fo:table-header>
<!-- If there is a caption element, output a table-footer -->
@ -103,6 +108,7 @@
<fo:table-body>
<xsl:apply-templates select="tbody/tr | tr">
<xsl:with-param name="spacerSpanColumns" select="$spacerSpanColumns"/>
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
</fo:table-body>
</fo:table>
@ -110,6 +116,7 @@
</xsl:template>
<!-- Generation for tables without THEAD and TBODY -->
<xsl:template match="table[count(thead)=0]" name="html-find-max-columns">
<xsl:param name="fileName"/>
<!-- Before we do anything, we need to scan the table to find the maximum span -->
<xsl:param name="row">1</xsl:param>
<xsl:param name="maxColumns">1</xsl:param>
@ -138,16 +145,19 @@
<xsl:call-template name="html-find-max-columns">
<xsl:with-param name="row" select="$row+1"/>
<xsl:with-param name="maxColumns" select="$newMaxColumns"/>
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="html-print-table">
<xsl:with-param name="spacerSpanColumns" select="$newMaxColumns"/>
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="html-print-table">
<xsl:param name="fileName"/>
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:comment> :::::: New table :::::: </xsl:comment>
<fo:block xsl:use-attribute-sets="table.padding">
@ -175,7 +185,9 @@
-->
<xsl:if test="tr[1][count(*)=count(th)]">
<!-- Process any tr elements -->
<xsl:apply-templates select="tr[1][count(*)=count(th)]"/>
<xsl:apply-templates select="tr[1][count(*)=count(th)]">
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
<!-- Add a spacer: 4 pt total, 1 pt black line -->
<xsl:comment> Table heading bottom spacer </xsl:comment>
<fo:table-row keep-with-previous="always">
@ -205,6 +217,7 @@
<fo:table-body>
<xsl:apply-templates select="tr[count(*)!=count(th)]">
<xsl:with-param name="spacerSpanColumns" select="$spacerSpanColumns"/>
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
</fo:table-body>
</fo:table>
@ -212,6 +225,7 @@
</xsl:template>
<!-- body table row -->
<xsl:template match="table/tr | table/tbody/tr">
<xsl:param name="fileName"/>
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:variable name="nColumns" select="count(th | td)
+ sum(th/@colspan |td/@colspan)
@ -227,7 +241,9 @@
<!-- Format the table row -->
<xsl:comment> ::: Table body row <xsl:value-of select="position()"/> (<xsl:value-of select="$nColumns"/> columns) ::: </xsl:comment>
<fo:table-row xsl:use-attribute-sets="table.body.row">
<xsl:apply-templates select="th|td"/>
<xsl:apply-templates select="th|td">
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
</fo:table-row>
<!-- Add in a spacer/border row -->
<xsl:comment> ::: Table row spacer for row <xsl:value-of select="position()"/> ::: </xsl:comment>
@ -257,20 +273,26 @@
</xsl:template>
<!-- a row containing at least a head cell -->
<xsl:template match="table/tbody/tr[th] | table/tr[th]">
<xsl:param name="fileName"/>
<xsl:comment> ::: Subheading row ::: </xsl:comment>
<!-- Changed from table.body.row (a bug!) -->
<fo:table-row xsl:use-attribute-sets="table.subheading.row">
<xsl:apply-templates select="th|td"/>
<xsl:apply-templates select="th|td">
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
</fo:table-row>
</xsl:template>
<!-- The last row -->
<xsl:template match="table/tbody/tr[last()] | table/tr[last()]">
<xsl:param name="fileName"/>
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:variable name="nColumns" select="count(th|td) + sum(th/@colspan|td/@colspan) - count(th/@colspan|td/@colspan)"/>
<!-- Format the table row -->
<xsl:comment> ::: Table body row <xsl:value-of select="position()"/> (<xsl:value-of select="$nColumns"/> columns) ::: </xsl:comment>
<fo:table-row xsl:use-attribute-sets="table.body.row">
<xsl:apply-templates select="th|td"/>
<xsl:apply-templates select="th|td">
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
</fo:table-row>
<!-- Add a spacer/border row: last row rule -->
<xsl:comment> ::: Table row spacer for last row ::: </xsl:comment>
@ -285,9 +307,12 @@
</xsl:template>
<!-- the table head -->
<xsl:template match="thead">
<xsl:param name="fileName"/>
<xsl:param name="spacerSpanColumns">1</xsl:param>
<!-- Process any tr elements -->
<xsl:apply-templates select="tr"/>
<xsl:apply-templates select="tr">
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
<!-- Add a spacer: 4 pt total, 1 pt black line -->
<xsl:comment> Table heading bottom spacer </xsl:comment>
<fo:table-row keep-with-previous="always">
@ -300,25 +325,36 @@
</xsl:template>
<!-- Table heading rows -->
<xsl:template match="table/tr[1][count(*)=count(th)] | thead/tr">
<xsl:param name="fileName"/>
<xsl:comment> ::: Table heading row <xsl:value-of select="position()"/> ::: </xsl:comment>
<fo:table-row xsl:use-attribute-sets="table.title.row">
<!-- Process any th or td elements -->
<xsl:apply-templates select="th|td"/>
<xsl:apply-templates select="th|td">
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
</fo:table-row>
</xsl:template>
<!-- Table heading cell -->
<xsl:template match="table/tbody/tr/th | table/tr/th">
<xsl:param name="fileName"/>
<xsl:comment> : Table subheading cell : </xsl:comment>
<fo:table-cell xsl:use-attribute-sets="table.subheading.cell">
<xsl:apply-templates select="@rowspan"/>
<xsl:apply-templates select="@colspan|@align"/>
<xsl:apply-templates select="@rowspan">
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="@colspan|@align">
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
<fo:block xsl:use-attribute-sets="table.subheading.block">
<xsl:apply-templates/>
<xsl:apply-templates>
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:table-cell>
</xsl:template>
<!-- A heading cell -->
<xsl:template match="table/tr[1][count(*)=count(th)]/th | table/thead/tr/th | table/thead/tr/td">
<xsl:param name="fileName"/>
<xsl:comment> : Table heading cell <xsl:value-of select="position()"/> : </xsl:comment>
<fo:table-cell xsl:use-attribute-sets="table.heading.cell">
<xsl:if test="@colspan">
@ -326,19 +362,28 @@
<xsl:attribute name="border-after-width">0.75pt</xsl:attribute>
<xsl:attribute name="border-after-color">black</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="@colspan|@rowspan|@align"/>
<xsl:apply-templates select="@colspan|@rowspan|@align">
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
<fo:block xsl:use-attribute-sets="table.heading.block">
<xsl:apply-templates/>
<xsl:apply-templates>
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:table-cell>
</xsl:template>
<!-- A table cell -->
<xsl:template match="td">
<xsl:param name="fileName"/>
<xsl:comment> : Table body cell <xsl:value-of select="position()"/> : </xsl:comment>
<fo:table-cell xsl:use-attribute-sets="table.body.cell">
<xsl:apply-templates select="@colspan|@align|@rowspan"/>
<xsl:apply-templates select="@colspan|@align|@rowspan">
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
<fo:block xsl:use-attribute-sets="table.body.block">
<xsl:apply-templates/>
<xsl:apply-templates>
<xsl:with-param name="fileName"><xsl:value-of select="$fileName"/></xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:table-cell>
</xsl:template>

View File

@ -25,6 +25,7 @@
</properties>
<body>
<release version="2.5-SNAPSHOT" date="in SVN">
<action dev="ltheussl" type="fix" issue="MPPDF-54">Identical ids in tables in different documents caused a build failure.</action>
<action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated :
<ul>
<li>xercesImpl v 2.4.0 -> v2.6.2</li>