0

how to navigate the XML file and get all a list of nodes in order to access their attributes and count no of nodes in Student tag.

for example :

Can anybody briefy me .how to do ? give any sample code to do so.?

1 Answer 1

0

You can get a collection of XmlNodes from and XmlDocument like this

XmlNodeList nodes = document.GetElementsByTagName("MyNodeName");
foreach (XmlNode node in nodes)
{
    // do stuff with each node
}

The XmlNode class has an Attributes property which is a collection of attributes. You can iterate through them and match the attributes you are looking for.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.