When importing an XML into xlsx spreadsheet (using XSSFImportFromXML) the data type isn't considered when setting the cell values. All values are saved as string. The data type (getXmlDataType: STXmlDataType.Enum) should be considered. The possible values are available on STXmlDataType as constants. Patch including fix and a test will follow shortly. Additional info: - used POI version: 3.9 - used Excel version: 2010
Created attachment 32714 [details] Patch including fix and test case
Description of the changes made in the patch: XSSFImportFromXML will now consider the data type defined in the XML schema when filling the data of the xml into cells. It differentiates between Boolean, Integer, Data and String. Any unknown data types are handled as Strings. If the string value can't be parsed into the required data type (e.g. Integer or Date) it will result in a IllegalArgumentException. Currently not all STXmlDataTypes are handled. For an example refer to the test and test data in the patch.
Thanks for the patch, this is now applied via SVN r1703665