-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
confirmedThis issue can be reproducedThis issue can be reproduced
Description
Description
If any of the XML special characters <, >, &, " were used in SetDropList() choices, the produced file will be reported as corrupted.
Steps to reproduce the issue:
package main
import (
"github.com/360EntSecGroup-Skylar/excelize/v2"
)
func main() {
var jobs = []string{"R&D", "PM", "UX", "HR"}
newWorkbookWithDropList(jobs)
}
func newWorkbookWithDropList(choices []string) {
f := excelize.NewFile()
dv := excelize.NewDataValidation(false)
dv.Sqref = "A:A"
if err := dv.SetDropList(choices); err != nil {
panic(err)
}
f.AddDataValidation(f.GetSheetName(0), dv)
f.SaveAs("TestDropList.xlsx")
}Describe the results you received:
Describe the results you expected:
Output of go version:
go version go1.17rc1 linux/amd64
Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, etc.):
The following official implementation were tested, and all of them could reproduce this issue:
- Microsoft Office 365 for Mac, 16.49 (21050901)
- Microsoft Office 365 for Windows, 2102 (Build 13801.20808)
- Microsoft Office 2019 Professional Plus for Windows, 2105 (Build 14026.20302)
- Microsoft Office 2013 Professional Plus for Windows, 15.0.4919.1002
The following third-party implementations were also tested, but none of them was affected by the issue:
- Kingsoft WPS
- Apple Numbers
- Google Sheets
- LibreOffice
Metadata
Metadata
Assignees
Labels
confirmedThis issue can be reproducedThis issue can be reproduced


