| 9119 | } |
| 9120 | |
| 9121 | xpath_string eval_string(const xpath_context& c, const xpath_stack& stack) |
| 9122 | { |
| 9123 | switch (_type) |
| 9124 | { |
| 9125 | case ast_string_constant: return xpath_string_const(_data.string); |
| 9126 | |
| 9127 | case ast_func_local_name_0: |
| 9128 | { |
| 9129 | xpath_node na = c.n; |
| 9130 | |
| 9131 | return xpath_string_const(local_name(na)); |
| 9132 | } |
| 9133 | |
| 9134 | case ast_func_local_name_1: |
| 9135 | { |
| 9136 | xpath_allocator_capture cr(stack.result); |
| 9137 | |
| 9138 | xpath_node_set_raw ns = _left->eval_node_set(c, stack); |
| 9139 | xpath_node na = ns.first(); |
| 9140 | |
| 9141 | return xpath_string_const(local_name(na)); |
| 9142 | } |
| 9143 | |
| 9144 | case ast_func_name_0: |
| 9145 | { |
| 9146 | xpath_node na = c.n; |
| 9147 | |
| 9148 | return xpath_string_const(qualified_name(na)); |
| 9149 | } |
| 9150 | |
| 9151 | case ast_func_name_1: |
| 9152 | { |
| 9153 | xpath_allocator_capture cr(stack.result); |
| 9154 | |
| 9155 | xpath_node_set_raw ns = _left->eval_node_set(c, stack); |
| 9156 | xpath_node na = ns.first(); |
| 9157 | |
| 9158 | return xpath_string_const(qualified_name(na)); |
| 9159 | } |
| 9160 | |
| 9161 | case ast_func_namespace_uri_0: |
| 9162 | { |
| 9163 | xpath_node na = c.n; |
| 9164 | |
| 9165 | return xpath_string_const(namespace_uri(na)); |
| 9166 | } |
| 9167 | |
| 9168 | case ast_func_namespace_uri_1: |
| 9169 | { |
| 9170 | xpath_allocator_capture cr(stack.result); |
| 9171 | |
| 9172 | xpath_node_set_raw ns = _left->eval_node_set(c, stack); |
| 9173 | xpath_node na = ns.first(); |
| 9174 | |
| 9175 | return xpath_string_const(namespace_uri(na)); |
| 9176 | } |
| 9177 | |
| 9178 | case ast_func_string_0: return string_value(c.n, stack.result); |
no test coverage detected