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
davy smith
NA
7
0
how to display parent node attribute name in xmlDocument
Feb 17 2011 10:01 AM
hi, im trying to display the attribute name of the parent node once the input matches a town name:
my xml is:
<phonebook>
<area code="022">
<town>mallow</town>
</area>
<area code="023">
<town>bandon</town>
<town>bray</town>
</area>
<area code="024">
<town>youghal</town>
</area>
<area code="025">
<town>fermoy</town>
</area>
</phonebook>
and method is:
private void btnGetNum_Click(object sender, EventArgs e)
{
XmlNodeList towns = doc.GetElementsByTagName("town");
foreach (XmlNode town in towns)
{
if (txtInput.Text.Equals(town.ChildNodes[0].Value))
{
lstResult.Items.Add("area code is" + ??????????);
}
}
Reply
Answers (
1
)
Insert new row and label/textbox in template field.
Decompile .exe into C# Visual Studio 2008