| 11179 | } |
| 11180 | |
| 11181 | xpath_string eval_string(const xpath_context& c, const xpath_stack& stack) |
| 11182 | { |
| 11183 | switch (_type) |
| 11184 | { |
| 11185 | case ast_string_constant: |
| 11186 | return xpath_string::from_const(_data.string); |
| 11187 | |
| 11188 | case ast_func_local_name_0: |
| 11189 | { |
| 11190 | xpath_node na = c.n; |
| 11191 | |
| 11192 | return xpath_string::from_const(local_name(na)); |
| 11193 | } |
| 11194 | |
| 11195 | case ast_func_local_name_1: |
| 11196 | { |
| 11197 | xpath_allocator_capture cr(stack.result); |
| 11198 | |
| 11199 | xpath_node_set_raw ns = _left->eval_node_set(c, stack, nodeset_eval_first); |
| 11200 | xpath_node na = ns.first(); |
| 11201 | |
| 11202 | return xpath_string::from_const(local_name(na)); |
| 11203 | } |
| 11204 | |
| 11205 | case ast_func_name_0: |
| 11206 | { |
| 11207 | xpath_node na = c.n; |
| 11208 | |
| 11209 | return xpath_string::from_const(qualified_name(na)); |
| 11210 | } |
| 11211 | |
| 11212 | case ast_func_name_1: |
| 11213 | { |
| 11214 | xpath_allocator_capture cr(stack.result); |
| 11215 | |
| 11216 | xpath_node_set_raw ns = _left->eval_node_set(c, stack, nodeset_eval_first); |
| 11217 | xpath_node na = ns.first(); |
| 11218 | |
| 11219 | return xpath_string::from_const(qualified_name(na)); |
| 11220 | } |
| 11221 | |
| 11222 | case ast_func_namespace_uri_0: |
| 11223 | { |
| 11224 | xpath_node na = c.n; |
| 11225 | |
| 11226 | return xpath_string::from_const(namespace_uri(na)); |
| 11227 | } |
| 11228 | |
| 11229 | case ast_func_namespace_uri_1: |
| 11230 | { |
| 11231 | xpath_allocator_capture cr(stack.result); |
| 11232 | |
| 11233 | xpath_node_set_raw ns = _left->eval_node_set(c, stack, nodeset_eval_first); |
| 11234 | xpath_node na = ns.first(); |
| 11235 | |
| 11236 | return xpath_string::from_const(namespace_uri(na)); |
| 11237 | } |
| 11238 |
no test coverage detected