From e61cfa7c22cb846e6ea3c74d51a6c5927c8f47d1 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Wed, 29 Apr 2009 17:42:10 +0100 Subject: [PATCH] [moulette] XmlListener: fixed a bug with string allocation --- src/moulette/listeners/xml-listener.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/moulette/listeners/xml-listener.cc b/src/moulette/listeners/xml-listener.cc index 9cd8b2f..111e6f1 100644 --- a/src/moulette/listeners/xml-listener.cc +++ b/src/moulette/listeners/xml-listener.cc @@ -22,7 +22,8 @@ namespace moulette { rapidxml::xml_attribute<> * attr = 0; rapidxml::xml_node<> * node = - doc_.allocate_node(rapidxml::node_element, test->isTestSuite() ? "TestSuite" : "Test"); + doc_.allocate_node(rapidxml::node_element, + test->isTestSuite() ? "TestSuite" : "Test"); node_->append_node(node); attr = doc_.allocate_attribute("name", test->name().c_str()); @@ -46,9 +47,12 @@ namespace moulette { std::stringstream ss; + //std::cerr << it->first << " " << it->second << std::endl; ss << it->second; - rapidxml::xml_node<> * child = doc_.allocate_node(rapidxml::node_element, "Detail"); - attr = doc_.allocate_attribute(it->first.c_str(), ss.str().c_str()); + rapidxml::xml_node<> * child = + doc_.allocate_node(rapidxml::node_element, "Detail"); + attr = doc_.allocate_attribute(it->first.c_str(), + doc_.allocate_string(ss.str().c_str())); child->append_attribute(attr); node_->append_node(child); } -- 2.11.4.GIT