| 10637 | } |
| 10638 | |
| 10639 | xpath_string eval_string(const xpath_context& c, const xpath_stack& stack) |
| 10640 | { |
| 10641 | switch (_type) |
| 10642 | { |
| 10643 | case ast_string_constant: |
| 10644 | return xpath_string::from_const(_data.string); |
| 10645 | |
| 10646 | case ast_func_local_name_0: |
| 10647 | { |
| 10648 | xpath_node na = c.n; |
| 10649 | |
| 10650 | return xpath_string::from_const(local_name(na)); |
| 10651 | } |
| 10652 | |
| 10653 | case ast_func_local_name_1: |
| 10654 | { |
| 10655 | xpath_allocator_capture cr(stack.result); |
| 10656 | |
| 10657 | xpath_node_set_raw ns = _left->eval_node_set(c, stack, nodeset_eval_first); |
| 10658 | xpath_node na = ns.first(); |
| 10659 | |
| 10660 | return xpath_string::from_const(local_name(na)); |
| 10661 | } |
| 10662 | |
| 10663 | case ast_func_name_0: |
| 10664 | { |
| 10665 | xpath_node na = c.n; |
| 10666 | |
| 10667 | return xpath_string::from_const(qualified_name(na)); |
| 10668 | } |
| 10669 | |
| 10670 | case ast_func_name_1: |
| 10671 | { |
| 10672 | xpath_allocator_capture cr(stack.result); |
| 10673 | |
| 10674 | xpath_node_set_raw ns = _left->eval_node_set(c, stack, nodeset_eval_first); |
| 10675 | xpath_node na = ns.first(); |
| 10676 | |
| 10677 | return xpath_string::from_const(qualified_name(na)); |
| 10678 | } |
| 10679 | |
| 10680 | case ast_func_namespace_uri_0: |
| 10681 | { |
| 10682 | xpath_node na = c.n; |
| 10683 | |
| 10684 | return xpath_string::from_const(namespace_uri(na)); |
| 10685 | } |
| 10686 | |
| 10687 | case ast_func_namespace_uri_1: |
| 10688 | { |
| 10689 | xpath_allocator_capture cr(stack.result); |
| 10690 | |
| 10691 | xpath_node_set_raw ns = _left->eval_node_set(c, stack, nodeset_eval_first); |
| 10692 | xpath_node na = ns.first(); |
| 10693 | |
| 10694 | return xpath_string::from_const(namespace_uri(na)); |
| 10695 | } |
| 10696 |
no test coverage detected