Parse EXI and create xml with one API
Embeddable EXI Processor in C
Status: Alpha
Brought to you by:
kjussakov
Parsing exi and Creating XML with just one API without worrying about the multiple callbacks would be really handy. I tried that out by doing the same as you did in the decoder example. Basically, in the contentHandler structure I added a placeholder for a buffer to hold xml. Also some other variables to hold the state. Modified in grammers.c to fill the buffer for xml wherever the callbacks are being called (used push and pop functions just like in decoder example). Very nasty hack maybe, but served the purpose. It will be great if you could maybe do it in a better manner ( as my understanding of the code is not complete).
Regards,
Naren
Anonymous
Hi,
thanks for the comments. This feature was discussed few times already when we started the project. I fully understand your point and agree that in some cases EXI to XML is useful to have in the parser. I will not go into details, but I will try to point out why I am against the solution you suggested:
- XML namespaces are not handled correctly there
- you need to ensure some streaming capabilities - not always a fixed size buffer for the XML will work
However it is quite straight forward to implement such functionality as a separate module using the EXIP API. As you said, very similar to decoder example. Just to throw some ideas here:
- You can create a function, say convertEXI() that gets almost the same parameters as parseEXI() but also a buffer and output streaming handles for writing text XML output
- In this function you use the parseEXI() and the content handler callbacks to write XML and send it to the application calling the convertEXI()
As this is not a priority for us at the moment I don't believe we will work on that in near future. If you want to work on such module, and contribute it to the project I will gladly help with whatever I can.
Regards,
Rumen
hi Rumen
if have plan to encode to exi? now i have used the exip libray,and neet to encode xml to exi and decode exi to xml