-
Notifications
You must be signed in to change notification settings - Fork 61
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
Implemented function to find sub nodes from root node #96
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments.
High-level question: does Poco XML not support xpath queries?
Don't know, and to be honest, I haven't used xpath queries before. I just built upon implementations I did 5-6 years ago, and I haven't look for other solutions. |
Co-authored-by: G.A. vd. Hoorn <[email protected]>
Co-authored-by: G.A. vd. Hoorn <[email protected]>
8ffd186
to
b6b946f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok as-is, but please take a look at the comments.
* | ||
* \return std::vector<Poco::XML::Node*> with the children (empty if none are found, or if the root node is nullptr). | ||
*/ | ||
std::vector<Poco::XML::Node*> xmlFindNodes(Poco::XML::Node* p_root, const XMLAttribute& attribute); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this function is not expected to change anything in p_root
, then perhaps we should make it a const ptr and accept the Node
also only as const
?
std::vector<Poco::XML::Node*> xmlFindNodes(Poco::XML::Node* p_root, const XMLAttribute& attribute); | |
std::vector<Poco::XML::Node*> xmlFindNodes(Poco::XML::Node const* const p_root, const XMLAttribute& attribute); |
I don't know whether Poco::XML::NodeIterator
accepts that though.
Related question: perhaps pass a const&
instead? I realise you work with pointers elsewhere, but passing const&
may actually be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know whether
Poco::XML::NodeIterator
accepts that though.
I just tested, and it didn't accept it.
Related question: perhaps pass a
const&
instead? I realise you work with pointers elsewhere, but passingconst&
may actually be better.
I just created #103 to track this.
Thanks for the review @gavanderhoorn 👍 |
As per title.