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

PhpSpreadsheet content.xml in ODS file must be minified only #804

Closed
akimsullec opened this issue Dec 5, 2018 · 3 comments · Fixed by #4087
Closed

PhpSpreadsheet content.xml in ODS file must be minified only #804

akimsullec opened this issue Dec 5, 2018 · 3 comments · Fixed by #4087

Comments

@akimsullec
Copy link

This is:

- [*] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

Read ODS files without errors

What is the current behavior?

Fatal error: Uncaught Error: Call to undefined method DOMText::hasAttributeNS() in {{some path prefix}}/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php:467 Stack trace: #0

What are the steps to reproduce?

Some ODS generators as Trassir devices for example, makes ODS format reports with unminified content.xml file in ODS archive.
Just unminify content.xml in any ODS archive and you'll catch the error.

Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:

<?php

require __DIR__ . '/vendor/autoload.php';

// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();

// add code that show the issue here...

Which versions of PhpSpreadsheet and PHP are affected?

php 7.0
phpss - latest

@stale
Copy link

stale bot commented Feb 4, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Feb 4, 2019
@stale stale bot closed this as completed Feb 11, 2019
@cqix
Copy link

cqix commented Aug 12, 2019

A test file
test.ods.zip

@oleibman
Copy link
Collaborator

oleibman commented Jul 4, 2024

Reopening, expect fix soon.

@oleibman oleibman reopened this Jul 4, 2024
@stale stale bot removed the stale label Jul 4, 2024
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this issue Jul 4, 2024
Fix PHPOffice#804, opened in Dec. 2018, and closed as stale in Feb. 2019, and which I have re-opened to be closed properly by this PR. Better late than never, I suppose. A third party generated an ODS spreadsheet which PhpSpreadsheet could not read. By way of explanation, the xml in the file contained lots of whitespace between tags, which is wonderful for those humans among us who have to analyze it; but PhpSpreadsheet was not prepared for it. It is now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants