I'm new to XML ^ _ ^
<a>
<book>
<c>
<e>Val1</e>
</c>
<d>val2</d>
</book>
<book>
<c>
<e>Val3</e>
</c>
<d>val4</d>
</book>
Question: I need to get value inside each book first I use
XmlNodeList xnList = xDoc.SelectNodes("/a/book");
the problem node "c" has a child element "e", so I can not get its value, as I get directly from node "d"
foreach (XmlNode xn in xnList)
{
string Name = xn["e"].InnerText;
string Detail = xn["d"].InnerText;
}
thank
source
share