示例#1
0
文件: xml.cpp 项目: oeuftete/wx-xword
string_t Parser::GetInnerXML(node n)
{
    Visit(n);
    std::ostringstream stream;
    for (node child = n.first_child(); child; child = child.next_sibling())
        child.print(stream, "", pugi::format_raw);
    return decode_utf8(stream.str());
}
示例#2
0
文件: xml.cpp 项目: oeuftete/wx-xword
// Utility functions
void TextToStream(node n, std::ostringstream & stream)
{
    for (node child = n.first_child(); child; child = child.next_sibling())
    {
        pugi::xml_node_type type = child.type();
        if (type == pugi::node_pcdata || type == pugi::node_cdata)
            stream << child.value();
        else
            TextToStream(child, stream);
    }
}