GNOME Bugzilla – Bug 735298
Color axis name saved without xml encoding
Last modified: 2014-08-28 02:31:11 UTC
Gnumeric is proving to be a handy application for statistically screening data. Thank you very much for maintaining and developing it. I happened to notice that using the "&" character in the name of a custom color map for the Color-Axis of an XYZ matrix prevented gnumeric from loading the workbook file. When I typed something like $ gnumeric corrupted_workbook.gnumeric gnumeric complained with (gnumeric:8740): XML-CRITICAL **: xmlParseEntityRef: no name ** (gnumeric:8740): WARNING **: Document likely damaged. ** (gnumeric:8740): WARNING **: leaking extensions I uncompressed the workbook's XML with $ gunzip -c tmp/corrupted_workbook.gnumeric > tmp/corrupted_workbook.xml and found the corrupted line with $ xmlcopyeditor tmp/corrupted_workbook.xml xmlcopyeditor said "Error a"Error at line 1866967, column 24: not well-formed (invalid token)"t line 1866967, column 24: not well-formed (invalid token)" Line 1866967 contained <name>10% worst & best</name> Column 24 holds the space character after the "&". "10% worst & best" is the name I chose for a custom color map for the Color-Axis of an XYZ matrix. The xml suggests to me that gnumeric considers this a so called "GogAxisColorMap". I'm happy to report that replacing the "&" with "and" in the xml allowed gnumeric to load the file. Maybe gnumeric's dialog for naming custom color maps should stop users from entering "&"s. Thanks again, Kingsley
There is nothing wrong with having a '&' in a name. The problem seems to be it is not correctly encoded when written to the file.
in gog-axis-color-map.c inside save_name_cb we have gsf_xml_out_add_cstr_unchecked (output, NULL, name); which writes the name without escaping characters in it. THat should be gsf_xml_out_add_cstr (output, NULL, name);
Jean, do you agree with the analysis?
Morten, sure, I missed that. Andreas, please commit.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.