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
tvkswamy
NA
13
3.9k
Search XML with C#
Dec 19 2015 9:17 AM
Hi
I have an XML of this format.
<?xml version="1.0" encoding="utf-8"?>
<Body xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<A>
<B>
<SH>
<last_update_time>2015-02-26</last_update_time>
<D></D>
<comments>Monitor</comments>
</SH>
<SH>
<last_update_time>2015-02-27</last_update_time>
<D>YYY</D>
<comments>Printer</comments>
</SH>
</B>
</A>
</Body>
I want to populate a list as
2015-02-26
,
XXX
,
Monitor
2015-02-27
,
YYY
,
Printer
In my code (C# - Winform) I have composed as below.
XmlNodeList xNode = xd.SelectNodes("/Body/A/B/SH");
foreach (XmlNode xndNode in xNode)
{
string LU = xndNode["last_update_time"].InnerText;
string D = xndNode["
D
"].InnerText;
string Comments = xndNode["comments"].InnerText;
}
Yet, I am not able to get the desired output. Any help where I have gone wrong, please.
Reply
Answers (
2
)
How to create custom events?
How can I include house address finder in my application?