tfussell / xlnt

:bar_chart: Cross-platform user-friendly xlsx library for C++11+
Other
1.5k stars 423 forks source link

unxepected_element throws exception while opening xls file. #210

Closed i-prudnikov closed 7 years ago

i-prudnikov commented 7 years ago

Hello, I have an uncaught exception while opening xlsx file. The reason is that worksheet element "tableParts" in XML header of the xlsx document looks unknown to parser. To fix this I added in my own copy of xlnt parser, into xlsx_consumer.cpp file, these lines, before line 2023, in function "void xlsx_consumer::read_worksheet(const std::string &rel_id)": else if (current_worksheet_element == qn("spreadsheetml", "tableParts")) { skip_remaining_content(current_worksheet_element); } To prevent trowing exception (I'm in debug) through this call "unexpected_element(current_worksheet_element);". Would it be feasible to add this into the code?

tfussell commented 7 years ago

Certainly. I just haven't had a chance to implement every element in the spec. I'll merge in the pull request if you want to make one or I can commit the change when I get the time.

i-prudnikov commented 7 years ago

Thomas, thank you for fast reply. I will do a pull request, once I have time :)

tfussell commented 7 years ago

I have disabled THROW_ON_INVALID_XML by default so this should not be occurring anymore. Closing this issue.

i-prudnikov commented 7 years ago

Hi Thomas, thanks to letting me know!