| 3647 | } |
| 3648 | |
| 3649 | PUGI__FN void recursive_copy_skip(xml_node& dest, const xml_node& source, const xml_node& skip) |
| 3650 | { |
| 3651 | assert(dest.type() == source.type()); |
| 3652 | |
| 3653 | switch (source.type()) |
| 3654 | { |
| 3655 | case node_element: |
| 3656 | { |
| 3657 | dest.set_name(source.name()); |
| 3658 | |
| 3659 | for (xml_attribute a = source.first_attribute(); a; a = a.next_attribute()) |
| 3660 | dest.append_attribute(a.name()).set_value(a.value()); |
| 3661 | |
| 3662 | for (xml_node c = source.first_child(); c; c = c.next_sibling()) |
| 3663 | { |
| 3664 | if (c == skip) |
| 3665 | continue; |
| 3666 | |
| 3667 | xml_node cc = dest.append_child(c.type()); |
| 3668 | assert(cc); |
| 3669 | |
| 3670 | recursive_copy_skip(cc, c, skip); |
| 3671 | } |
| 3672 | |
| 3673 | break; |
| 3674 | } |
| 3675 | |
| 3676 | case node_pcdata: |
| 3677 | case node_cdata: |
| 3678 | case node_comment: |
| 3679 | case node_doctype: dest.set_value(source.value()); break; |
| 3680 | |
| 3681 | case node_pi: |
| 3682 | dest.set_name(source.name()); |
| 3683 | dest.set_value(source.value()); |
| 3684 | break; |
| 3685 | |
| 3686 | case node_declaration: |
| 3687 | { |
| 3688 | dest.set_name(source.name()); |
| 3689 | |
| 3690 | for (xml_attribute a = source.first_attribute(); a; a = a.next_attribute()) |
| 3691 | dest.append_attribute(a.name()).set_value(a.value()); |
| 3692 | |
| 3693 | break; |
| 3694 | } |
| 3695 | |
| 3696 | default: assert(!"Invalid node type"); |
| 3697 | } |
| 3698 | } |
| 3699 | |
| 3700 | inline bool is_text_node(xml_node_struct* node) |
| 3701 | { |
no test coverage detected