示例#1
0
static bool saveXML(pugi::xml_document& document, const std::string& outputFile)
{
	pugi::xml_node decl = document.prepend_child(pugi::node_declaration);
	decl.append_attribute("version").set_value("1.0");
	decl.append_attribute("encoding").set_value("utf-8");
	if(!document.save_file(outputFile.c_str(), " ", 1U, pugi::encoding_utf8))
	{
		return false;
	}

	return true;
}