TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Parul Maheshwari
NA
13
6.3k
Read all xml nodes with same name and their childNodes in c#
Aug 17 2017 3:20 PM
My xml file looks something like this:
<academic>
<school1>
<grade1>
<student>
<name>John</name>
<age>7</age>
</student>
<student>
<name>Julie</name>
<age>8</age>
</student>
</grade1>
<grade2>
<student>
<name>Michael</name>
<age>8</age>
</student>
<student>
<name>Dave</name>
<age>8</age>
</student>
</grade2>
</school1>
<school2>
<grade1>
<student>
<name>Mary</name>
<age>9</age>
</student>
<student>
<name>Johnson</name>
<age>7</age>
</student>
</grade1>
</school2>
</academic>
The tags 'school1', 'school2', 'grade1', 'grade2' are dynamically created. And number of <student> tags under each grade are also dynamic.
I want to read all <student> and its childNodes for <grade1>, <grade2> separately. How can I do that?
Since there are dynamic tags, I am able to read all <student> together and store it in a List<string>.
But I want to read them individually according to the grade.
Reply
Answers (
4
)
MetroTextbox (MetroFramework): ScrollToCaret???
How to Add a Security Token to SOAP message?