2 ms·
start("abc", x="1.0", y="2.0") <abc y="2.0" x="1.0"> Ok, I can imagine people wanting this. Especially people coming form Javascript. However `<abc y="2.0
by thomasahle 10y ago
start("abc", x="1.0", y="2.0")
<abc y="2.0" x="1.0">
Ok, I can imagine people wanting this. Especially people coming form Javascript.
However `<abc y="2.0" x="1.0">` and `<abc x="1.0" y="2.0">` are semantically equivalent in XML, aren't they?
- masklinn 10y agoXML itself doesn't no, humans may, and some crappy crummy tools sadly do as well[0]. Round-tripping ordering is also convenient for automated processing tools as well (e.g. add/remove parameters without introducing extraneous unnecessary changes) [0] some also do care about namespace aliases/prefixes, which is a bit of a shock the first time they choke on your perfectly valid and namespaced XML.
- dalke 10y agoThey are equivalent. That doesn't mean that all tools will use XML semantics to test for equivalence. A testing tool might require that the output is byte-for-byte equivalent to a known good output. Python's pseudorandomly determined hash function won't preserve that order across multiple runs.