I have used expat and want to convert my code to use libxml2 sax parser. I have 2 questions:
Q1) expat provides api XML_SetUserData(), i want similar api in libxml2.
Q2) Does libxml2 sax parser allow schema validati开发者_运维知识库on along with parsing the xml.
Thanks SM
xmlSAXHandlerinstance.userdata = your_data; should do the needful.
You will get this data in all your callbacks then.
You can also set user data when you instantiate your Parser context. Eg: xmlCreatePushParserCtxt(&xmlSAXHandlerinstance, your_data, NULL, 0, NULL);
精彩评论