Hi,
I am trying to access an attribute which is in a nested
node but I always get a null value.
Can a nested node have attributes or is just the property
of a parent node
<Animals>
<Dog>
<Name>Ruff</Name>
<Attributes Count="2">
<Value>Bark</Value>
<Value>Bite</Value>
</Attributes>
</Dog>
</Animals>
Is the Count attribute valid, if yes how can I access it
Currently I am trying the following
xr.ReadStartElement("Animals");
while(xr.Read()) //where xr is pointing to the file
{
xr.ReadStartElement("Dog");
string name = xr.ReadElementString("Name");
string count = xr.GetAttribute("Count"); //gets null
xr.ReadStartElement("Attributes"); //tried putting
//above but doesnt work
.........
.......
}
what am I doing wrong here
Thanks in advance
Regards,
tribal