MCPcopy Create free account
hub / github.com/WheretIB/nullc / evaluate_node_set

Method evaluate_node_set

external/pugixml/pugixml.cpp:9482–9510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9480 }
9481
9482 xpath_node_set xpath_query::evaluate_node_set(const xpath_node& n) const
9483 {
9484 if (!_impl) return xpath_node_set();
9485
9486 xpath_ast_node* root = static_cast<xpath_query_impl*>(_impl)->root;
9487
9488 if (root->rettype() != xpath_type_node_set)
9489 {
9490 #ifdef PUGIXML_NO_EXCEPTIONS
9491 return xpath_node_set();
9492 #else
9493 xpath_parse_result result;
9494 result.error = "Expression does not evaluate to node set";
9495
9496 throw xpath_exception(result);
9497 #endif
9498 }
9499
9500 xpath_context c(n, 1, 1);
9501 xpath_stack_data sd;
9502
9503 #ifdef PUGIXML_NO_EXCEPTIONS
9504 if (setjmp(sd.error_handler)) return xpath_node_set();
9505 #endif
9506
9507 xpath_node_set_raw r = root->eval_node_set(c, sd.stack);
9508
9509 return xpath_node_set(r.begin(), r.end(), r.type());
9510 }
9511
9512 const xpath_parse_result& xpath_query::result() const
9513 {

Callers 2

select_single_nodeMethod · 0.80
select_nodesMethod · 0.80

Calls 6

xpath_node_setClass · 0.85
rettypeMethod · 0.80
eval_node_setMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected