Closed GoogleCodeExporter closed 9 years ago
Nodes do not exist without the document, because the document takes care of
memory management for node data. So the only efficient way to build XML tree is
top-to-bottom.
If we're still talking about nested set model, the nodes in the database should
have the tree traversal order, meaning that when you get to node A, it's parent
is already processed (i.e. it's already in the document).
Original comment by arseny.k...@gmail.com
on 18 Jul 2011 at 11:00
Exactly, I am still in the Nested Set model.
So the best way I see as per your suggestion is a Breadth First Traversal of
the tree.
Can you suggest a way to do it as I am confused designing an algo for the same.
Original comment by devesh...@gmail.com
on 18 Jul 2011 at 11:21
[deleted comment]
Given that a when I reach a node A, its parent is already processed and is
present in the document, how do I find the parent and append this node it its
respective parent.
Original comment by devesh...@gmail.com
on 18 Jul 2011 at 11:29
I'm attaching an example of XML <-> nested set conversion using pugixml (note
that this implementation is not really pugixml-specific; it does not even use a
node->(left,right) map).
Original comment by arseny.k...@gmail.com
on 20 Jul 2011 at 4:59
Attachments:
Closing the issue; if there's anything else, feel free to update it and I'll
reopen it.
Original comment by arseny.k...@gmail.com
on 22 Jul 2011 at 5:21
Original issue reported on code.google.com by
devesh...@gmail.com
on 18 Jul 2011 at 10:52