Making Xerces parse a string instead of a file

后端 未结 3 1845
情深已故
情深已故 2020-12-14 18:36

I know how to create a complete dom from an xml file just using XercesDOMParser:

xercesc::XercesDOMParser parser = new xercesc::XercesDOMParser();
parser->         


        
3条回答
  •  悲&欢浪女
    2020-12-14 19:36

    Use the following overload of XercesDOMParser::parse():

    void XercesDOMParser::parse(const InputSource& source);
    

    passing it a MemBufInputSource:

    MemBufInputSource src((const XMLByte*)myxml.c_str(), myxml.length(), "dummy", false);
    parser->parse(src);
    

提交回复
热议问题