Mix of ' and " for xml string
Hi,
This is a really minor one, but would really help when debugging issue and comparing the generated xml. The code has a mix of single and double quotes for the xml string:
vs
for instance pptx/chart/xmlwriter.py it looks like PowerPoint uses/expects double quotes. When you open and save a generated PPTX in PowerPoint it converts all the single quotes to double.
Can you be more specific? What minimal code demonstrates this behavior?
I happen to be in that neighborhood today so can fix it if it's easy.
Oh looks like the editor nuked my text in the orriginal is should have been:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
vs
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Easy fix would be a global search and replace for the string with single quotes and replace with double
What is the problem this causes for you? By default, lxml writes the XML declaration with single-quotes, so I'd be inclined to leave things as they are. However if you can find a place where we write double-quotes maybe that's the better fix.
And "by default" I also mean it's pretty hard to change because it doesn't let you choose.
I'm not really getting a problem with the module, I was trying to fix the transparent negative chart values I'm getting by comparing a pptx directly from python-pptx and the same pptx opened in PowerPoint fixed by hand and saved again. I got a huge amount of differences, but they were almost all just changing from single quotes to double quotes, so it seems PowerPoint uses double quotes.
I did a search on the code base and 83 files have the xml version line with single quotes (mostly under the doc dir) and 30 files have the line with double quotes, for instance:
As I said, it's not a big deal. Feel free just to close the issue.
BTW, this is how I fixed the negative chart values:
# Fix for negative values in a chart
for series in chart.series:
for i in range(0, len(series.values)):
series.points[i].invert_if_negative = False
series.invert_if_negative = False