XML Relationships in Subclassses

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff T.

    #1

    XML Relationships in Subclassses

    Hello,
    I have an existing set of C# classes that encapsulate our application data.
    They are in a heirachy with each subclass defining more specific types of
    data. I would like to serialize these data objects as XML but perserve the
    relationships in the XML document. For example, if my classes were:


    public class GenericItem
    {



    }


    public class MoreSpecific : GenericItem
    {


    }


    public class VerySpecific : MoreSpecific
    {


    }


    I would like the XML document to look like,
    <GenericItem>
    <MoreSpecific >
    <VerySpecific ></VerySpecific>
    </MoreSpecific>
    </GenericItem>

    Does anyone know which XML Attributes I should apply to my class properties
    so these relationships are maintained? Any advice or suggestions are greatly
    appreciated.


    Thanks,
    Jeff


Working...