Skip to content
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

wish to add another xml_node::traverse function meber #77

Closed
baixuefeng opened this issue Jan 5, 2016 · 5 comments
Closed

wish to add another xml_node::traverse function meber #77

baixuefeng opened this issue Jan 5, 2016 · 5 comments

Comments

@baixuefeng
Copy link

at present, the xml_node::traverse function:
...
if (!walker.for_each(arg_for_each))
return false;
...

But, sometimes, I want to use it like this:
...
if (walker.for_each(arg_for_each) && cur.first_child())
{
// traverse it's child tree
}
else
...

@zeux
Copy link
Owner

zeux commented Jan 5, 2016

I don't understand the use case. Why can't you check this condition inside your for_each implementation?

@baixuefeng
Copy link
Author

Case 1: When the function "for_each" return false , all traverse ended;
Case 2: When the function "for_each" return false, it mean that it only will not traverse it's child tree, but will continue to traverse it's sibling.

@zeux
Copy link
Owner

zeux commented Jan 10, 2016

Ah, right. Yeah, this makes sense. Unfortunately, I can't easily change the existing interface because of binary compatibility issues. The interface has some other problems as well (e.g. https://code.google.com/p/pugixml/issues/detail?id=219) that warrant changing it though, so maybe it's necessary to introduce a new interface at this point and deprecate the old one.

@baixuefeng
Copy link
Author

Haha, I think so too.

@zeux
Copy link
Owner

zeux commented Jul 16, 2016

Closing in favor of #103, which has several different options and thoughts on the matter.

@zeux zeux closed this as completed Jul 16, 2016
@zeux zeux added the duplicate label Jul 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants