| 6706 | } |
| 6707 | |
| 6708 | PUGI__FN xpath_string string_value(const xpath_node& na, xpath_allocator* alloc) |
| 6709 | { |
| 6710 | if (na.attribute()) |
| 6711 | return xpath_string_const(na.attribute().value()); |
| 6712 | else |
| 6713 | { |
| 6714 | const xml_node& n = na.node(); |
| 6715 | |
| 6716 | switch (n.type()) |
| 6717 | { |
| 6718 | case node_pcdata: |
| 6719 | case node_cdata: |
| 6720 | case node_comment: |
| 6721 | case node_pi: return xpath_string_const(n.value()); |
| 6722 | |
| 6723 | case node_document: |
| 6724 | case node_element: |
| 6725 | { |
| 6726 | xpath_string result; |
| 6727 | |
| 6728 | xml_node cur = n.first_child(); |
| 6729 | |
| 6730 | while (cur && cur != n) |
| 6731 | { |
| 6732 | if (cur.type() == node_pcdata || cur.type() == node_cdata) |
| 6733 | result.append(xpath_string_const(cur.value()), alloc); |
| 6734 | |
| 6735 | if (cur.first_child()) |
| 6736 | cur = cur.first_child(); |
| 6737 | else if (cur.next_sibling()) |
| 6738 | cur = cur.next_sibling(); |
| 6739 | else |
| 6740 | { |
| 6741 | while (!cur.next_sibling() && cur != n) |
| 6742 | cur = cur.parent(); |
| 6743 | |
| 6744 | if (cur != n) |
| 6745 | cur = cur.next_sibling(); |
| 6746 | } |
| 6747 | } |
| 6748 | |
| 6749 | return result; |
| 6750 | } |
| 6751 | |
| 6752 | default: return xpath_string(); |
| 6753 | } |
| 6754 | } |
| 6755 | } |
| 6756 | |
| 6757 | PUGI__FN unsigned int node_height(xml_node n) |
| 6758 | { |
nothing calls this directly
no test coverage detected