i need to replicate the following in XML, but unsure how to do this:
<FAMILY>
<NAME>
<AGE>
<DATEOFBIRTH>
<NAME>
<AGE>
<DATEOFBIRTH>
<NAME>
<AGE>
<DATEOFBIRTH>
<NAME>
<AGE>
<DATEOFBIRTH>
</FAMILY>
i’m using a very basic example to explain what i need assistance with.
the XML is generated from parsing a serialisable class:
[Serializable]
[XmlRoot("FAMILY")]
public class FamilyBlock
{
public string NAME { get; set; }
public int AGE { get; set; }
public DateTime? DOB { get; set; }
public FamilyBlock(string name, int age, DateTime? dob)
{
NAME = name;
AGE = age;
DOB = dob;
}
}
I attemped to resolve the problem with a list an object but i get the following (the addition of the object name – this i don’t need).
<FAMILY>
<MEMBER>
<NAME>
<AGE>
<DATEOFBIRTH>
</MEMBER>
<MEMBER>
<NAME>
<AGE>
<DATEOFBIRTH>
</MEMBER>
<MEMBER>
<NAME>
<AGE>
<DATEOFBIRTH>
</MEMBER>
<MEMBER>
<NAME>
<AGE>
<DATEOFBIRTH>
</MEMBER>
</FAMILY>
i’m sure this is a simple problem but i really dont have much knowledge of xml
After xml serialization looks like: