Closed metastable closed 1 year ago
In XML, the & character should be escaped.
https://www.w3.org/TR/REC-xml/#syntax (2.4 Character Data and Markup)
ws.header("<Left> & 'left' & \"LEFT\"", Position.LEFT, "Calibri", 12) ws.header("<Center> & 'center' & \"CENTER\"", Position.CENTER, "Calibri", 12) ws.header("<Right> & 'right' & \"RIGHT\"", Position.RIGHT, "Calibri", 12)
The output sheet1.xml is not escaped and cannot be opened in Excel.
sheet1.xml
<headerFooter differentFirst="false" differentOddEven="false"> <oddHeader>&L&"Calibri,Regular"&12&K000000<Left> & 'left' & "LEFT"&C&"Calibri,Regular"&12&K000000<Center> & 'center' & "CENTER"&R&"Calibri,Regular"&12&K000000<Right> & 'right' & "RIGHT"</oddHeader> <oddFooter></oddFooter> </headerFooter>
In XML, the & character should be escaped.
https://www.w3.org/TR/REC-xml/#syntax (2.4 Character Data and Markup)
The output sheet1.xml is not escaped and cannot be opened in Excel.
sheet1.xml