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

Minify XML output #414

Open
mattparks opened this issue Sep 25, 2019 · 1 comment
Open

Minify XML output #414

mattparks opened this issue Sep 25, 2019 · 1 comment

Comments

@mattparks
Copy link
Contributor

@mattparks mattparks commented Sep 25, 2019

I was testing xlnt output against the output from libxlsxwriter, when writing the same data the xlnt xlsx file was always larger. After doing some digging it appears that the internal xml files had whitespace enable (they are not minified).

It appears that I only had to change the follow line to minify the xml outputs:

current_part_serializer_.reset(new xml::serializer(current_part_stream_, part.string()));

This is the change I made on my fork: https://github.com/mattparks/xlnt/commit/6c32ca8745843aec77f58e7a904b8fca5a62fca5

@tfussell
Copy link
Owner

@tfussell tfussell commented Dec 19, 2019

I didn't minify it yet as it makes debugging more difficult, but it makes sense to allow the developer to choose. I'll make this configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.