I want to make my own xml-serializer class because I need other formatting than the System.Xml.Serialization.XmlSerializer does. My idea is to treat properties of primitive type (such as Integer, Double, String) as XmlAttributes.
To properly implement a usable Xml-Serialization I need to know which variables point to the same object (the binary serialization behaves this way). Because one object should be serialized only once in order that the connections don't get lost. On the side of XmlSerialisation I have the idea to insert a path to the class as a special XmlAttribute.
Do you have tipps for me how to handle such a situation?
### EDITThanks for the answers.
XmlAttributeAttribute is maybe more work than writing my own Serializer because only variables of primitive types (and there are many of them) should be serialized as XmlAttributes. Making a mistake there is more horrible then.
I would use a kind of Hashing solution (of course) so far so good. But my idea was to reduce the work of this hashing solution, if I could make sure the object is referenced only once.
Do you have links to such a question?