DEV Community

Discussion on: Hello XML, My Old Friend; I've Come To Encode You Again.

Collapse
 
millebi profile image
Bill Miller

One of the most important things: Sequencing! In XML (and JSON too) the order in which items are inserted into the resulting string can be extremely important. The biggest problems are Name/Value pair objects (i.e. a:{"first":"1", "second":"2"...}) where most of the serialization libraries will dump them in some partially predicatable sequence but if that's not what the "other end" is expecting or is validating against (DTD's anyone?) it may fail for stupid reasons.

Also beware of numeric precision. A string representation of a float value may not have been serialized "properly" depending upon your needs. Especially if the value was supposed to be encoded using hex, octal or BCD instead of "simple" base 10.