/// Copy all nodes in the tree to the node_set void node_set::v_copy_selected_node_recursive ( const TiXmlNode * XNp_root, ///< The node to be copied const char * cp_lookup) ///< Lookup name (or NULL) { const TiXmlAttribute * XAp_attrib; const TiXmlNode * XNp_child; if ((! cp_lookup) || ! strcmp (XNp_root -> Value (), cp_lookup)) v_add_node_in_set (XNp_root); if (XNp_root -> Type () == TiXmlNode::ELEMENT) { XAp_attrib = XNp_root -> ToElement () -> FirstAttribute (); while (XAp_attrib) { v_add_attrib_in_set (XAp_attrib); XAp_attrib = XAp_attrib -> Next (); } } XNp_child = XNp_root -> FirstChild (); while (XNp_child) { v_copy_selected_node_recursive (XNp_child, cp_lookup); XNp_child = XNp_child -> NextSiblingElement (); } }
/// Copy all nodes in the tree to the node_set void node_set::v_copy_selected_node_recursive ( const TiXmlNode * XNp_root) ///< The node to be copied { v_copy_selected_node_recursive (XNp_root, NULL); }
/// Copy all nodes in the tree to the node_set, knowing that we are copying the root void node_set::v_copy_selected_node_recursive_root_only ( const TiXmlNode * XNp_root, const TiXmlNode * XNp_base) { v_add_node_in_set (XNp_root); v_copy_selected_node_recursive (XNp_base, NULL); }