| 12799 | } |
| 12800 | |
| 12801 | PUGI__FN xpath_node xpath_query::evaluate_node(const xpath_node& n) const |
| 12802 | { |
| 12803 | impl::xpath_ast_node* root = impl::evaluate_node_set_prepare(static_cast<impl::xpath_query_impl*>(_impl)); |
| 12804 | if (!root) return xpath_node(); |
| 12805 | |
| 12806 | impl::xpath_context c(n, 1, 1); |
| 12807 | impl::xpath_stack_data sd; |
| 12808 | |
| 12809 | impl::xpath_node_set_raw r = root->eval_node_set(c, sd.stack, impl::nodeset_eval_first); |
| 12810 | |
| 12811 | if (sd.oom) |
| 12812 | { |
| 12813 | #ifdef PUGIXML_NO_EXCEPTIONS |
| 12814 | return xpath_node(); |
| 12815 | #else |
| 12816 | throw std::bad_alloc(); |
| 12817 | #endif |
| 12818 | } |
| 12819 | |
| 12820 | return r.first(); |
| 12821 | } |
| 12822 | |
| 12823 | PUGI__FN const xpath_parse_result& xpath_query::result() const |
| 12824 | { |
no test coverage detected