Using XML decorations to specify default values during de-serialization
问题 I have a problem deserializing some XML; the XML supplied by a third party is quite verbose, so if there is no value set for an particular element, it will supply and empty element (e.g. <element1 /> ). This is a problem for certain elements, for example, those that are meant to store integers. I have control over the third party, so I could either get them to specify a default value ( <myinteger>0</myinteger> ) or I can get them to omit these elements entirely. Both of these should avoid the