GNOME Bugzilla – Bug 547183
some XML elements depend on having the attributes sorted
Last modified: 2008-08-11 11:12:16 UTC
I was writing a python module that reads a gnumeric file and just writes it back again. I noticed that everything worked except the column width wasn't preserved. The python module changed the order in which XML attributes are written in the XML file. If I use a text editor to change this part of the XML file back, then it works again: <gnm:Cols DefaultSizePts="48"> <gnm:ColInfo HardSize="1" No="0" Unit="114" /> <gnm:ColInfo HardSize="1" No="1" Unit="394.5" /> <gnm:ColInfo HardSize="1" No="2" Unit="73.5" /> <gnm:ColInfo HardSize="1" No="3" Unit="51.75" /> <gnm:ColInfo HardSize="1" No="4" Unit="31.5" /> <gnm:ColInfo No="5" Unit="27.75" /> </gnm:Cols> was changed into: <gnm:Cols DefaultSizePts="48"> <gnm:ColInfo No="0" Unit="114" HardSize="1"/> <gnm:ColInfo No="1" Unit="394.5" HardSize="1"/> <gnm:ColInfo No="2" Unit="73.5" HardSize="1"/> <gnm:ColInfo No="3" Unit="51.75" HardSize="1"/> <gnm:ColInfo No="4" Unit="31.5" HardSize="1"/> <gnm:ColInfo No="5" Unit="27.75"/> </gnm:Cols> On irc this behavior was confirmed, it seems necessary that No comes first. The XML spec however says attributes do not need to be ordered.
Created attachment 116296 [details] [review] proposed patch
Both branches. Fixed.