Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Iterating through DOM tree using an Iterator (http://www.velocityreviews.com/forums/t755025-iterating-through-dom-tree-using-an-iterator.html)

hajer 10-20-2011 06:53 AM

Iterating through DOM tree using an Iterator
 
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


All times are GMT. The time now is 04:59 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.