Helper to make a vector of pugi::xml_node matching a tag: any level
| 31 | |
| 32 | // Helper to make a vector of pugi::xml_node matching a tag: any level |
| 33 | std::vector<pugi::xml_node> makeVectorOfChildrenRecursive(const pugi::xml_node& root, const std::string& tagName) { |
| 34 | std::vector<pugi::xml_node> result; |
| 35 | // We use xpath '//tagName' |
| 36 | for (const pugi::xpath_node& n : root.select_nodes((std::string("//") + tagName).c_str())) { |
| 37 | result.push_back(n.node()); |
| 38 | } |
| 39 | return result; |
| 40 | } |
| 41 | |
| 42 | // Lexical cast the text() of a node as a double |
| 43 | boost::optional<double> lexicalCastToDouble(const pugi::xml_node& element) { |
no test coverage detected