HI,
I would like to have the configuration data for my application stored in a XML config file that I modify manually, however, I’m not sure how I would go about storing more complex types.
For example, If I wanted to store X,Y coordinates and I had a class to represent this, its easy enough to specify the data type, but I have no idea how this would look serialized.
So how can I change an XML file by hand and represent complex types.
There are two ways to store structured data in XML: attributes, and child elements. Attributes are easier to use, but only support primitive types; child elements support nested types and arrays as well.
Suppose you have your class Point, and support you have a value origin of type Point. Using attributes, the xml should look like this
If you want child elements instead, you write