how to display parent node attribute name in xmlDocument

xmlparser , parentnode , get attribute name United Kingdom
  • 10 years ago
    hi, im trying to display the attribute name of the parent node once the input matches a town name:
    

    my xml is:

    mallow bandon bray
    youghal
    fermoy
    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" + ??????????); } }

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Better train people and risk they leave – than do nothing and risk they stay.” - Anonymous