> Eric Ulevik wrote:
> 
> What is the right way to parse a XML string using Xerces-c?
> 
> I would like to process XML from char*, std::string, wchar_t*.

You can use MemBufInputSource like this:

SAXParser *parser = new SAXParser();
[etc, set up parser properly]

char* xml_buf = "<xml> my xml document </xml>";
MemBufInputSource *memBufIS = new MemBufInputSource((const XMLByte
*)xml_buf, strlen(xml_buf), "My XML Data", false);
try {
        parser->parse(*memBufIS);
}
catch(some exception) {
        [etc]
}

I think the MemParse sample shows the full code.

HTH,
Mike.

-- 
Mike Mason, Software Engineer
XML Script Development Team                    Office: 44-1865-203192
http://www.xmlscript.org/                      Mobile: 44-7050-288923

Reply via email to