mahendratyagi / php-spreadsheetreader

Automatically exported from code.google.com/p/php-spreadsheetreader
Other
0 stars 0 forks source link

Multiline column values in Openoffice spreadsheets (ods) are not read properly #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Multiline column values in Openoffice spreadsheets (ods) are not read properly. 
Only the first line is read and the remaining lines are ignored.

Original issue reported on code.google.com by amaramra...@gmail.com on 5 Dec 2010 at 5:42

GoogleCodeExporter commented 9 years ago
I can confirm that this is still the case with revision 27
Any recommendations would be welcome

Original comment by g.duerrm...@gmail.com on 10 Jun 2011 at 3:41

GoogleCodeExporter commented 9 years ago
I got lucky and found on a Russian blog the solution to fixing this problem.

Source: http://www.kapralov.com/articles/php_ods_parser

The solution is to replace the following:
<xsl:value-of select="text:p"/>

With the following:
<xsl:for-each select="text:p">
  <xsl:value-of select="." />
  <xsl:if test="position() != last()"> </xsl:if>
</xsl:for-each>

Now using #160 as non-breaking space works, however I haven't tried 
alternatives to better preserve fidelity of the original spreadsheet. In any 
case this blog brilliantly solved my problem.

Original comment by g.duerrm...@gmail.com on 10 Jun 2011 at 6:22

GoogleCodeExporter commented 9 years ago
Great thanks for the fix! Works fine now!

Original comment by dereks...@gmail.com on 10 Oct 2011 at 3:39