| 6029 | } |
| 6030 | |
| 6031 | PUGI__FN xpath_string string_value(const xpath_node& na, xpath_allocator* alloc) |
| 6032 | { |
| 6033 | if (na.attribute()) |
| 6034 | return xpath_string_const(na.attribute().value()); |
| 6035 | else |
| 6036 | { |
| 6037 | const xml_node& n = na.node(); |
| 6038 | |
| 6039 | switch (n.type()) |
| 6040 | { |
| 6041 | case node_pcdata: |
| 6042 | case node_cdata: |
| 6043 | case node_comment: |
| 6044 | case node_pi: |
| 6045 | return xpath_string_const(n.value()); |
| 6046 | |
| 6047 | case node_document: |
| 6048 | case node_element: |
| 6049 | { |
| 6050 | xpath_string result; |
| 6051 | |
| 6052 | xml_node cur = n.first_child(); |
| 6053 | |
| 6054 | while (cur && cur != n) |
| 6055 | { |
| 6056 | if (cur.type() == node_pcdata || cur.type() == node_cdata) |
| 6057 | result.append(xpath_string_const(cur.value()), alloc); |
| 6058 | |
| 6059 | if (cur.first_child()) |
| 6060 | cur = cur.first_child(); |
| 6061 | else if (cur.next_sibling()) |
| 6062 | cur = cur.next_sibling(); |
| 6063 | else |
| 6064 | { |
| 6065 | while (!cur.next_sibling() && cur != n) |
| 6066 | cur = cur.parent(); |
| 6067 | |
| 6068 | if (cur != n) cur = cur.next_sibling(); |
| 6069 | } |
| 6070 | } |
| 6071 | |
| 6072 | return result; |
| 6073 | } |
| 6074 | |
| 6075 | default: |
| 6076 | return xpath_string(); |
| 6077 | } |
| 6078 | } |
| 6079 | } |
| 6080 | |
| 6081 | PUGI__FN unsigned int node_height(xml_node n) |
| 6082 | { |
nothing calls this directly
no test coverage detected