Issue 28460: Minidom, order of attributes, datachars (original) (raw)
Hello, just an idea for improvement of minidom.
Sometimes it is not convenient that the element attributes are sorted alphabetically.
Usually, users do hack the minidom file themselves to force some behaviour, yet the order can be quite nicely defined by the DTD, for example.
More on the "issue" side is another idea for improvement. Not all special characters do need to be changed to entities. For example, only < needs to be changed to entity in text data. I guess, that the _write_data function could be then diminished as well...
What do you mean of these two ideas? Comments will be appreciated.
I'll close this as a duplicate of issue 34160.
I'm aware that you also proposed to reduce the text escaping, but it's still needed for attribute values. Not sure if it's really worth having two different escape functions. Feel free to provide a PR and create a new ticket for this, so that we can discuss a specific change proposal. It's not good to discuss more than one topic per ticket.