locked
Reading Xml File contents? RRS feed

  • Question

  • Hi all,

    I'm trying to read the contents of an Xml file. I tried soemthing like this.

    XmlDocument doc = new XmlDocument();

    doc.Load(<XmlFile>);

     

    I need to access the nodes with the Tagname "Object" So I tried,

    XmlNodeList list = doc.GetElementsbyTagName("Object");

    Further I couldn't access the contents within this node.

    I mean withing this <Object> Tag, I have some data which I need to access. I didn't get how to reach to those contents within <Object> and </Object> tags.

    Am I using the proper method for reading the Xml files? anybody pls let me know how to access the data from an Xml file.

    Thank you all.

    Soujanya.

    Tuesday, February 27, 2007 10:51 AM

All replies

  • Hi,

    have a look at following,

    XmlNodeList elemList = doc.GetElementsByTagName("title");
    for (int i=0; i < elemList.Count; i++)
    {  
        Console.WriteLine(elemListIdea.InnerXml);



    Shamir
    Tuesday, February 27, 2007 12:00 PM