-
Notifications
You must be signed in to change notification settings - Fork 713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better node visitor interface #103
Labels
Comments
I believe this is a useful feature and I have a custom implementation of options 1+3 at https://github.com/jamsilva/pugixml_tree_visitor. Feel free to use, change and distribute it under the same license as pugixml. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assuming node visitor interface is a good idea (is it? not 100% clear), there are several problems with existing xml_tree_walker:
While manually implementing a recursive traversal is pretty trivial, all traversals that pugixml implements are stackless (which is not as simple/concise to write yourself), so there seems to be some value in a generic traversal. There are still several implementation options though:
These need to be evaluated for the performance and versatility in various scenarios. 1 and 2 are extensions of existring ::traverse() support while 3 is basically a separate idea.
Finally, there is - as it is - quite a few ways to traverse the nodes in pugixml. Ideally if we do need a new way it has to supplant the old one - that is, we should at the minimum deprecate existing ::traverse in favor of whatever the new interface is.
The text was updated successfully, but these errors were encountered: