workbook.xml saved in openpyxl does not contain the "<?xml " tag

Issue #623 invalid
Jonatã Bolzan Loss created an issue


Comparing the original xlsx and the edited xlsx, you can note that the initial <xml tag is not present on the edited file.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

This line is not present on the resulting workbook.xml file.

Thanks for your attention.

Comments (5)

  1. Jonatã Bolzan Loss reporter

    I understand it is not required, but why not let the final worksheet the same way the original is? Could be the case (that is my case) when some system trying to grab some information from this xml expect this pattern.

  2. CharlieC

    Sounds like you need to use a better library.

    1:1 identity is not a design goal and more or less not achievable in any case. The library works with the file format as defined by ECMA 476 / ISO something.

    All the XML handling is done either by the standard library's etree module or lxml. lxml will actually reject XML with a UTF-8 encoding (XML is UTF-8) by default.

  3. Log in to comment