| 13065 | } |
| 13066 | |
| 13067 | PUGI__FN xpath_node xpath_query::evaluate_node(const xpath_node& n) const |
| 13068 | { |
| 13069 | impl::xpath_ast_node* root = impl::evaluate_node_set_prepare(static_cast<impl::xpath_query_impl*>(_impl)); |
| 13070 | if (!root) return xpath_node(); |
| 13071 | |
| 13072 | impl::xpath_context c(n, 1, 1); |
| 13073 | impl::xpath_stack_data sd; |
| 13074 | |
| 13075 | impl::xpath_node_set_raw r = root->eval_node_set(c, sd.stack, impl::nodeset_eval_first); |
| 13076 | |
| 13077 | if (sd.oom) |
| 13078 | { |
| 13079 | #ifdef PUGIXML_NO_EXCEPTIONS |
| 13080 | return xpath_node(); |
| 13081 | #else |
| 13082 | throw std::bad_alloc(); |
| 13083 | #endif |
| 13084 | } |
| 13085 | |
| 13086 | return r.first(); |
| 13087 | } |
| 13088 | |
| 13089 | PUGI__FN const xpath_parse_result& xpath_query::result() const |
| 13090 | { |
no test coverage detected