I'm working to create a library for my app in C. I want to parse a XML file in my code. So, how can i do it in C ?
I know its java implementation but how can i parse a XML in my C code ?
What are the libraries that can be used for the purpose ?
I'm working to create a library for my app in C. I want to parse a XML file in my code. So, how can i do it in C ?
I know its java implementation but how can i parse a XML in my C code ?
What are the libraries that can be used for the purpose ?
I suggest Expat, I've used with many projects and it is very simple to use and has extremely small overhead. Its code base is also quite stable.
Expat is an XML parser library written in C. It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags).
However with every other external project mentioned, you need to build it yourself.
you should use c library for parsing xmls. here are some famous library links.. you can check
http://www.jclark.com/xml/expat.html
http://tibleiz.net/asm-xml/benchmark.html
you can find many other library to parse xml. But if you have any lightweight parsing task then you can use
I have used http://www.minixml.org/ so i suggest to use this. Minixml is quite simple and easy to understand and use.
So you can download whole code of minixml and cross compile it for Android using Android toolchain or android NDK. And now Link that library to your jni code and use its API in your c code.
Just refference for includeing 3rd party library in jni code see