I have a char* buffer of data that I want to parse as XML in libxml2.
How would one go about that?
Currently I am using it to open the file automatically by calling a file name, but it would be nice to have more functionality.
Currently I do it like this:
xmlDocPtr doc = xmlParseFile("data/foo.xml");
However I have a resource system that gives me access to the raw data, so my more preferred method would be:
resource_base_ptr res = load_resource("data/foo.xml"); xmlDocPtr doc /*= some_function(res->raw_data) */;
You need to use xmlReadMemory()