falcong / pugixml

Automatically exported from code.google.com/p/pugixml
0 stars 0 forks source link

text method of pugi::xml_node returns empty xml string #171

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
pugi::xml_node node = mXmlDocument->fist_child();

cost pugi::char_t *xmltext = node.text().as_string(); // returns empty string

There is no way we can derive the xml string in string format from 
pugi::xml_node object.

Any fix or resolution would be a great help.

Original issue reported on code.google.com by rajesh.s...@gmail.com on 9 Sep 2012 at 6:44

GoogleCodeExporter commented 9 years ago
Please, give an example of what you're actually trying to achieve.

I suspect that you want something like this:
std::ostringstream oss;
node.print(oss);
std::string xmltext = oss.str();

But I'm not completely sure.

Original comment by arseny.k...@gmail.com on 10 Sep 2012 at 2:33

GoogleCodeExporter commented 9 years ago
Hi,
Your suspicion is right. This is what I was looking for, xml text of a node.

Thanks and Best Regards,
Rajesh

Original comment by rajesh.s...@gmail.com on 10 Sep 2012 at 8:30

GoogleCodeExporter commented 9 years ago

Original comment by arseny.k...@gmail.com on 17 Sep 2012 at 8:32