#include #include #include #include int main() { std::cout << "Begin." << std::endl; xmlpp::DomParser parser; const std::string strXml("\ \n\ \n\ " ); parser.parse_memory(strXml); // Get root node xmlpp::Node * pRootNode = parser.get_document()->get_root_node(); assert(pRootNode); // Get attribute xmlpp::Element * pElementNode = dynamic_cast(pRootNode); assert(pElementNode); // !!! No mem leak reported if next line excluded const std::string strAttributeValue(pElementNode->get_attribute_value("a") ); // Remove attribute // !!! No mem leak reported if next line excluded pElementNode->remove_attribute("a"); std::cout << "End." << std::endl; }