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