Iterating through DOM tree using an Iterator

Discussion in 'C Programming' started by hajer, Oct 20, 2011.

  1. hajer

    hajer

    Joined:
    Oct 20, 2011
    Messages:
    1
    Hello,

    I'm creating a C++ program that manipulates xml files using DOM tree and MSXML parser. I have to iterate through this DOM tree. It can be possible using methods like GetNextSibling, GetFirstChild, GetParent,...
    But what I want to do when iterating is to be able to go directly to the next node in the structure, without having to test wether I need to call GetNextSibling, GetFirstChild or GetParent
    For example let's say I have this xml file structure

    <A>
    <B>
    <E/>
    <F/>
    </B>
    <C/>
    <D/>
    </A>

    I want to use some iterator that will allow me to call a certain GetNext method or something like that in such a may that I can iterate through this structure like that :
    A - B - E - F - C - D

    I already implemented a logic to do so, but I want to know if there is a ready to use one, so I don't have to reinvent the wheel.

    Thanks in advance for any help or advice.

    Hajer OUALHA
    hajer, Oct 20, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joris Gillis
    Replies:
    2
    Views:
    1,514
    Joris Gillis
    Jun 16, 2006
  2. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,076
  3. Hannu Krosing
    Replies:
    0
    Views:
    377
    Hannu Krosing
    May 15, 2006
  4. Fei Liu
    Replies:
    11
    Views:
    3,036
    Fei Liu
    Jun 29, 2007
  5. carl
    Replies:
    5
    Views:
    2,318
    James Kanze
    Nov 25, 2009
Loading...

Share This Page