Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell that contains <![CDATA[xxx]]> is not interpreted #79

Closed
Lb-lea opened this issue Sep 13, 2023 · 4 comments
Closed

Cell that contains <![CDATA[xxx]]> is not interpreted #79

Lb-lea opened this issue Sep 13, 2023 · 4 comments
Labels

Comments

@Lb-lea
Copy link

Lb-lea commented Sep 13, 2023

Hello,
I am trying to read a file produced by Excel and the header cells contains the <![CDATA markup
The headers basically looks like that (albeit simplified)

<table:table-header-rows>
  <table:table-row table:style-name="ro1">
  <table:table-cell table:style-name="ce1" office:value-type="string">
    <text:p><![CDATA[Column 1]]></text:p>
  </table:table-cell>
  <table:table-cell table:style-name="ce1" office:value-type="string">
    <text:p><![CDATA[Column 2]]></text:p>
  </table:table-cell>
  <table:table-cell table:style-name="ce1" office:value-type="string">
    <text:p><![CDATA[Column 3]]></text:p>
  </table:table-cell>
  </table:table-row>
</table:table-header-rows>

However in the sods SpreadSheet created with the file, the first row only contains null column. The other rowns are fine since they don´t have the cdata tag.

I have re-saved with LibreOffice and this time the cdata markup is gone and sods reads my file just fine.

I thus conclude that the cdata is what is preventing the cell values from being loaded.
After looking it up it turns out that the cdata markup marks data that contains character that could be interpreted as xml but should not.
Thus I think sods should be able interpret my cells as text values.

SODS version 1.6.2

As for providing a full file, sadly the file I have contains confidential data and I cannot reproduce the bug myself while trying to create a clean speadsheet on Excel

@Lb-lea Lb-lea changed the title Cell that contains <![CDATA[xxx}}> is not interpreted Cell that contains <![CDATA[xxx]]> is not interpreted Sep 13, 2023
@github-actions
Copy link

Thanks for your report! Please ensure you have provided enough info in order to recreate the issue, including the problematic ODS File.

@miachm
Copy link
Owner

miachm commented Sep 13, 2023

I tried to insert a <![CDATA[Column 1]]> in a xml.

SODS returns "Column 1" which it's the expected result. Whatever your problem is, it's not related with the CData modifier.

I need a way to reproduce it... Maybe you can make a copy of the file, delete all the rows content and post it here? A minimum viable example of 1 row is good enough.

@miachm miachm added the bug label Sep 13, 2023
@Lb-lea
Copy link
Author

Lb-lea commented Sep 20, 2023

I tried to reproduce a file. The original file is from a client so I'm not really sure how they ended up with that because if I re-save it in libreOffice so anonimise the rows the import it's fine 🙈
So I manually edited the content.xml and re-zipped the file. Not sure if it's legit but libreOffice seems to still read my file fine so I guess so...
The first row of the SimpleOdsReader is good: [Cell{value=Test 1, formula='null', style=, num_repeated=1}]
But the second row is null : [Cell{value=null, formula='null', style=, num_repeated=1}] instead of A
empty cell.ods

I hope it works (or I mean doesn´t work as well) with you.
Thank you for your time

miachm added a commit that referenced this issue Sep 22, 2023
@miachm
Copy link
Owner

miachm commented Sep 22, 2023

@Lb-lea should be fixed in 1.6.4

@miachm miachm closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants