| 9556 | } |
| 9557 | |
| 9558 | xpath_string eval_string(const xpath_context& c, const xpath_stack& stack) |
| 9559 | { |
| 9560 | switch (_type) |
| 9561 | { |
| 9562 | case ast_string_constant: |
| 9563 | return xpath_string::from_const(_data.string); |
| 9564 | |
| 9565 | case ast_func_local_name_0: |
| 9566 | { |
| 9567 | xpath_node na = c.n; |
| 9568 | |
| 9569 | return xpath_string::from_const(local_name(na)); |
| 9570 | } |
| 9571 | |
| 9572 | case ast_func_local_name_1: |
| 9573 | { |
| 9574 | xpath_allocator_capture cr(stack.result); |
| 9575 | |
| 9576 | xpath_node_set_raw ns = _left->eval_node_set(c, stack, nodeset_eval_first); |
| 9577 | xpath_node na = ns.first(); |
| 9578 | |
| 9579 | return xpath_string::from_const(local_name(na)); |
| 9580 | } |
| 9581 | |
| 9582 | case ast_func_name_0: |
| 9583 | { |
| 9584 | xpath_node na = c.n; |
| 9585 | |
| 9586 | return xpath_string::from_const(qualified_name(na)); |
| 9587 | } |
| 9588 | |
| 9589 | case ast_func_name_1: |
| 9590 | { |
| 9591 | xpath_allocator_capture cr(stack.result); |
| 9592 | |
| 9593 | xpath_node_set_raw ns = _left->eval_node_set(c, stack, nodeset_eval_first); |
| 9594 | xpath_node na = ns.first(); |
| 9595 | |
| 9596 | return xpath_string::from_const(qualified_name(na)); |
| 9597 | } |
| 9598 | |
| 9599 | case ast_func_namespace_uri_0: |
| 9600 | { |
| 9601 | xpath_node na = c.n; |
| 9602 | |
| 9603 | return xpath_string::from_const(namespace_uri(na)); |
| 9604 | } |
| 9605 | |
| 9606 | case ast_func_namespace_uri_1: |
| 9607 | { |
| 9608 | xpath_allocator_capture cr(stack.result); |
| 9609 | |
| 9610 | xpath_node_set_raw ns = _left->eval_node_set(c, stack, nodeset_eval_first); |
| 9611 | xpath_node na = ns.first(); |
| 9612 | |
| 9613 | return xpath_string::from_const(namespace_uri(na)); |
| 9614 | } |
| 9615 |
no test coverage detected