开发者

Need api similar to XML_SetUserData(expat) in libxml2

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);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜