Apache OpenOffice (AOO) Bugzilla – Issue 52214
Exporting simple table to xhtml outputs only first column
Last modified: 2013-08-07 15:12:27 UTC
Hi, It would seem that exporting a simple table to XHTML (from the spreadsheet app) only writes the first column to the XHTML file. Remaining columns are ignored. NOTE: The error only occurs if the first row is formatted as a heading (using F11 etc.) Test case used a simple 9 (rows) x 4 (cols) array of numbers but was intitially detected while trying to export a larger table of strings. Issue has so far only been tried on linux (SuSE 9.3) Regards, Charles
Could not reproduce using m118 build. Also the Prio was much to high. Frank
closed wfm
I beg to differ. I have just installed 1.9.118 on my system and consistently get the originally reported behaviour. NOTE: export to xhtml is ok if all cells are of template-type standard. Error only occurs if first row is changed to template-type 'heading' If I can find the link, I'll upload the odt and xhtml as a follow up. System: Linux charles 2.6.11.4-21.7-default #1 Thu Jun 2 14:23:14 UTC 2005 i686 i686 i386 GNU/Linux (SuSE Linux 9.3) Regards, Charles
Created attachment 28085 [details] spreadsheet file causing problem
Created attachment 28086 [details] xhtml output from prev. posting
Hi Swante, have a look at this one please. Frank
OCCURANCE: I can reproduce the issue, when I change the style for a complete row or table. By doing this only one table:table-column exists (in the content.xml), which is repeated 256 times. BACKGROUND: This issue comes from a workaround for XHTML, when too many repeated cells are involved For instance some Calc documents simulate a background by repeating empty cells with a certain style.. But this would result into very large XHTML writing out too many emty cells as there is no repeated attribute. In total 256 * 65536 = 16 777 216 cells might be written, creating several megabytes of XHTML, which is in general undesired by the user. XSLT FIX: The easiest fix for this issue is the exchange of two conditions in common/table/table_cells.xsl Changing test="$currentTableColumn[not(@table:visibility = 'collapse' or @table:visibility = 'filter')]"> to test="not($currentTableColumn[@table:visibility = 'collapse' or @table:visibility = 'filter'])"> In the latter case the variable currentTableColumn doesn't have to exist to return true.
Even repeated cells would work - repeated (empty) cells would be created, when adding content the end of the row, but skipping some (repeated empty) cells. Unfortunately the width (added by the column / colgroup) get lost. Even the similar repeated colums could be exchange to one columngroup (cmp. http://de.selfhtml.org/html/tabellen/aufbau.htm#vordefinieren) A valid expression as <colgroup class="co1" /> would not be recognized in the Mozilla Firefox 1.04 (Windows) Nevertheless it should be worth to be added in export\xhtml\table.xsl, so future browser might show it correct by exchanging the existing <xsl:element name="colgroup"> to: <xsl:element name="colgroup"> <xsl:choose> <xsl:when test="count(table:table-column) = 1"> <xsl:if test="not(table:table-column/@table:visibility = 'collapse' or table:table-column/@table:visibility = 'filter')"> <xsl:attribute name="class"><xsl:value-of select="table:table-column/@table:style-name"/></xsl:attribute> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:for-each select="$allTableColumns/table:table-column"> <xsl:if test="not(@table:visibility = 'collapse' or @table:visibility = 'filter')"> <xsl:element name="col"> <xsl:variable name="value" select="$globalData/all-ooo-styles/style[@style:name = current()/@table:style-name]/*/@style:column-width" /> <xsl:if test="$value"> <xsl:attribute name="width"> <!-- using the absolute width, problems with the relative in browser (in OOo style:rel-column-width) --> <xsl:call-template name="convert2px"> <xsl:with-param name="value" select="$globalData/all-ooo-styles/style[@style:name = current()/@table:style-name]/*/@style:column-width" /> </xsl:call-template> </xsl:attribute> </xsl:if> </xsl:element> </xsl:if> </xsl:for-each> </xsl:otherwise> </xsl:choose> </xsl:element>
The final add on for this fix - to keep the width attribute of the neglected repeated column in the cells - would be in xhtml\table.xsl exchanging the style creation beyond <!-- set column style (disjunct of cell style) --> <!-- set column style (disjunct of cell style) --> <xsl:choose> <xsl:when test="normalize-space($currentTableColumn) != ''"> <xsl:value-of select="$globalData/all-styles/style[@style:name = $currentTableColumn/@table:style-name]/final-properties" /> </xsl:when> <xsl:otherwise> <xsl:variable name="columnStyleName" select="ancestor::table:table/table:table-column/@table:style-name" /> <!-- no currentTableColumn means there is only one column repeated till the end --> <xsl:value-of select="$globalData/all-styles/style[@style:name = $columnStyleName]/final-properties" /> </xsl:otherwise> </xsl:choose>