PhpSpreadsheet/tests/data/Reader/XLSX
oleibman ad5532e2f4
Namespacing Phase 2 - Styles (#2471)
* WIP Namespacing Phase 2 - Styles

This is part 2 of a several-phase process to permit PhpSpreadsheet to handle input Xlsx files which use unexpected namespacing. The first phase, introduced as part of release 1.19.0, essentially handled the reading of data. This phase handles the reading of styles. More phases are planned.

It is my intention to leave this in draft status for at least a month. This will give time for additional testing, by me and, I hope, others who might be interested.

This fixes the same problem addressed by PR #2458, if it reaches mergeable status before I am ready to take this out of draft status. I do not anticipate any difficult merge conflicts if the other change is merged first.

This change is more difficult than I'd hoped. I can't get xpath to work properly with the namespaced style file, even though I don't have difficulties with others. Normally we expect:
```xml
<stylesheet xmlns="http://whatever" ...
```
In the namespaced files, we typically see:
```xml
<x:stylesheet xmlns:x="http://whatever" ...
```

Simplexml_load_file specifying a namespace handles the two situations the same, as expected. But, for some reason that I cannot figure out, there are significant differences when xpath processes the result. However, I can manipulate the xml if necessary; I'm not proud of doing that, and will gladly accept any suggestions. In the meantime, it seems to work.

My major non-standard unit test file had disabled any style-related tests when phase 1 was installed. These are now all enabled.

* Scrutinizer

Its analysis is wrong, but the "errors" it pointed out are easy to fix.

* Eliminate XML Source Manipulation

Original solution required XML manipulation to overcome what appears to be an xpath problem. This version replaces xpath with iteration, eliminating the need to manipulate the XML.

* Handle Some Edge Cases

For example, Style file without a Fills section.

* Restore RGB/ARGB Interchangeability

Fix #2494. Apparently EPPlus outputs fill colors as `<fgColor rgb="BFBFBF">` while most output fill colors as `<fgColor rgb="FFBFBFBF">`. EPPlus actually makes more sense. Regardless, validating length of rgb/argb is a recent development for PhpSpreadsheet, under the assumption that an incorrect length is a user error. This development invalidates that assumption, so restore the previous behavior.

In addition, a comment in Colors.php says that the supplied color is "the ARGB value for the colour, or named colour". However, although named colors are accepted, nothing sensible is done with them - they are passed unchanged to the ARGB value, where Excel treats them as black. The routine should either reject the named color, or convert it to the appropriate ARGB value. This change implements the latter.
2022-02-11 06:42:04 -08:00
..
PageSetup.xlsx Forgot to check in the test files for the unit tests 2020-07-05 16:28:46 +02:00
autofilterTest.xlsx Refactoring xlsx reader (#1033) 2019-06-30 23:42:25 +02:00
bug1686b.xlsx Fix for 3 Issues Involving ReadXlsx and NamedRange (#1742) 2020-12-10 18:08:10 +01:00
colortabs.xlsx Xlsx Reader Theme Support Broken After 17.1 (#2403) 2021-11-26 09:38:09 -08:00
condfmtnum.xlsx Handle ConditionalStyle NumberFormat When Reading Xlsx File (#1296) 2020-01-04 00:10:41 +01:00
conditionalFormatting2Test.xlsx Conditionals - Extend Support for (NOT)CONTAINSBLANKS (#1278) 2020-01-04 18:50:04 +01:00
conditionalFormatting3Test.xlsx #984 add support notContainsText for conditional styles in xlsx reader 2021-05-02 22:09:38 +02:00
conditionalFormattingDataBarTest.xlsx Support DataBar of conditional formatting rule (#1754) 2021-01-29 16:57:40 +01:00
conditionalFormattingTest.xlsx Refactoring xlsx reader (#1033) 2019-06-30 23:42:25 +02:00
dataValidation2Test.xlsx Fix for #2149 / Read data validations for drop down list in another sheet. (#2150) 2021-06-15 13:28:10 +02:00
dataValidationTest.xlsx Basic unit test and fix for loading data validations from xlsx file (#1063) 2019-07-08 19:55:14 +02:00
double_attr_drawing.xlsx Fix failure when parsing xlsx with drawing having double (redefined) … (#945) 2019-05-30 11:42:00 +02:00
drawingOneCellAnchor.xlsx Fix loading drawing size (#2492) 2022-01-16 21:59:31 -08:00
empty_drawing.xlsx Fix #853 when loading and saving XLSX file with empty drawing cause c… (#882) 2019-05-30 10:38:03 +02:00
excelChartsTest.xlsx Fix/chart axis titles (#1760) 2021-01-31 19:13:50 +01:00
explicitdate.xlsx Handle Explicit "Date" Type for Cell (#2485) 2022-01-13 18:40:18 -08:00
issue.1432b.xlsx Data Validations Referencing Another Sheet (#2265) 2021-08-24 08:58:38 -07:00
issue.2246a.xlsx Fix Reading XLSX files without styles.xml throws an exception. (#2247) 2021-08-16 05:05:32 -07:00
issue.2246b.xlsx Fix Reading XLSX files without styles.xml throws an exception. (#2247) 2021-08-16 05:05:32 -07:00
issue.2301.xlsx Xlsx Reader Better Namespace Handling Phase 1 Second Bugfix (#2303) 2021-09-27 16:59:45 -07:00
issue.2316.xlsx Corrections for Xlsx Read Comments (#2329) 2021-10-23 17:32:44 -07:00
issue.2331c.xlsx Unexpected Format in Timestamp (#2332) 2021-10-23 18:23:53 -07:00
issue.2362.xlsx ZipArchive and "Inconsistent" Zip File (#2376) 2021-11-12 01:18:57 -08:00
issue.2387.xlsx Xlsx Reader Theme Support Broken After 17.1 (#2403) 2021-11-26 09:38:09 -08:00
issue.2450.xlsx General Style Specified in Uppercase in Input Xlsx (#2451) 2021-12-18 09:25:08 -08:00
issue.2488.xlsx Xlsx Reader Cell DataType Numeric or Boolean Without Value (#2489) 2022-01-16 21:19:09 -08:00
issue.2494.xlsx Namespacing Phase 2 - Styles (#2471) 2022-02-11 06:42:04 -08:00
issue.2501.b.xlsx Xlsx Reader Merge Range For Entire Column(s) or Row(s) (#2504) 2022-01-23 10:44:09 -08:00
issue.2516b.xlsx fix warning when open xlsx file with thumbnail (#2517) 2022-01-24 14:17:53 -08:00
issue2109b.xlsx Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
namespacenonstd.xlsx Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
namespacepurl.xlsx Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
namespaces.openpyxl35.xlsx Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
namespaces.xlsx Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
namespacestd.xlsx Xlsx Reader Better Namespace Handling Phase 1 Try2 (#2173) 2021-06-25 09:05:49 +02:00
octo#thorpe.xlsx Read Spreadsheet with # in Name (#2409) 2021-11-30 07:39:50 -08:00
pageSetupTest.xlsx Refactoring xlsx reader (#1033) 2019-06-30 23:42:25 +02:00
pr1769e.xlsx Remove unnecessary changes. Added test 2021-04-19 11:25:48 +01:00
pr1769g.py.xlsx XLSX Reader and Empty Fill Tag (#2011) 2021-04-20 17:20:59 +02:00
pr2050cf-fill.xlsx Pattern Fill style should default to 'solid' if there is a pattern fill with colour but no style (#2050) 2021-04-30 20:05:45 +02:00
pr2225-datavalidation-onezero.xlsx Add unit tests for files with true/false (LibreOffice) in DataValidation boolean values and those with 1/0 (Excel, GoogleSheets) 2021-07-21 05:53:49 -07:00
pr2225-datavalidation-truefalse.xlsx Add unit tests for files with true/false (LibreOffice) in DataValidation boolean values and those with 1/0 (Excel, GoogleSheets) 2021-07-21 05:53:49 -07:00
propertyTest.xlsx Refactoring xlsx reader (#1033) 2019-06-30 23:42:25 +02:00
rowColumnAttributeTest.xlsx Refactoring xlsx reader (#1033) 2019-06-30 23:42:25 +02:00
sheetsChartsTest.xlsx Fix/sheets xlsx chart (#1761) 2021-01-31 18:53:54 +01:00
stylesTest.xlsx Refactoring xlsx reader (#1033) 2019-06-30 23:42:25 +02:00
urlImage.xlsx When image source is a URL, store the URL for use during extraction. (#2072) 2021-06-24 10:50:44 +02:00
without_cell_reference.xlsx Support missing attribute `r` in `c` node when reading xlsx 2017-09-22 14:49:38 +09:00