Bug 64750 - getDataValidations relies on the count attribute being present
Summary: getDataValidations relies on the count attribute being present
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 4.1.2-FINAL
Hardware: PC All
: P2 normal with 1 vote (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-18 10:17 UTC by Stuart Owen
Modified: 2021-01-01 16:07 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Owen 2020-09-18 10:17:42 UTC
This problem was discovered when having problems processing spreadsheets exported from Google Sheets.

Through some testing, it has been found that if the count attribute isn't present on the dataValidations element within the sheet.xml then the validations cannot be found by POI.

Manually inserting this attribute, and then repackaging the .xlsx file, and the validations can be found and processed successfully. 

Validating the xml against the schema suggests this attribute is optional.

A set of test cases and files confirming and demonstrating the problem can be found at https://github.com/stuzart/poi-google-export-testcase
Comment 1 Dominik Stadler 2021-01-01 16:07:39 UTC
Thanks for the very detailed reproducer!

This is fixed now on latest trunk via r1885011, we now only look at the array and ignore the "count" attribute to always handle elements even if count is not set.