Thread: getting the value of elements in a nodelist

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    85

    getting the value of elements in a nodelist

    i have an Xml document loaded and have used the folwing to get the nodelist for all elements with the tag "item".

    Code:
    XmlNodeList nodelist = Info.GetElementsByTagName("item");
    each "item" contains a number of nodes.

    how can i find out how many nodes exist in each element.

    i can use
    Code:
    foreach(XmlNode N in nodelist)
    {
    
    }
    to iterate through the nodes but i need to determine the count of the nodes before i get to this foreach statement.

    note: i am using an XmlDocument not an XmlReader.

  2. #2
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    There's a Count property for XMLNodeList.

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    85
    i dont want the xmlnode list count - i want the node count of each of the elements within xmlnodelist.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Adding More Array Elements?
    By Vermillion in forum C++ Programming
    Replies: 2
    Last Post: 09-14-2008, 10:02 PM
  2. using realloc for a dynamically growing array
    By broli86 in forum C Programming
    Replies: 10
    Last Post: 06-27-2008, 05:37 AM
  3. Randomly rearranging the elements in a vector
    By Signifier in forum C++ Programming
    Replies: 11
    Last Post: 08-01-2007, 12:21 PM
  4. way to check 3 elements of array and set 4th
    By Syneris in forum C++ Programming
    Replies: 3
    Last Post: 01-09-2006, 11:30 AM
  5. Replies: 2
    Last Post: 08-03-2003, 10:01 AM