i have the following XML file:
<IncidentTracker>
<IncidentType name = "Car crash" >
<Victim
Name ="John Cena"
Age ="18"
Gender = "Male"
ContractNumber ="123456789" />
</IncidentType>
</IncidentTracker>
i wrote
XmlNode root = xml.FirstChild;
if (root.HasChildNodes)
{
for( int x = 0; x < root.ChildNodes.Count; x++)
{
strInnocentTracker = root.ChildNodes[x].Attributes[0].Value;
}
}
it only return Car crash. What can i do so that it will return me all the attributes in the victim? Thanks