3

I want to generate a xml file through my C application and add entries to it dynamically. I almost know what should my xml look like, i mean its schema. Please let me know how to accomplish this in C.

2
  • See how to create xml message in c?. Commented Sep 5, 2011 at 4:17
  • The cited post doesn't mention either expat (a "classic" choice) or Xerces (arguably one of the best libraries available) Commented Sep 5, 2011 at 4:19

3 Answers 3

5

You can use an xml library like minixml.

It can read and write XML and XML-like data files in your application without requiring large non-standard libraries and Mini-XML only requires an ANSI C compatible compiler.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks!! Is it platform specific? My application needs to be ported on windows, linux etc.
@user911747: It is available for Windows, Unix as well as Linux.
Thanks. One more query: minixml vs Expat/Xerces ? which is a better choice and when do we use what?
@user911747: There is no Best solution for all.It is a matter of choice, preference and requirements in some cases, You will have to read through the docummentation of these libraries(through links provided in answers here) & evaluate what best suits your purpose/requirement.
4

"fopen()/fprintf()" will work just fine :)

"Expat" and "Xerces" are two very popular open-source libraries for XML.

2 Comments

Thanks!! I would explore both of them. Does any of these libraries give me some APIs to even parse an xml?
for just xml writing i would prefere this method but in case of reading xml file i use mxml...
3

you can use minixml or libxml library.

3 Comments

Thanks!! minixml vs Expat/Xerces ? which is a better choice and when do we use what?
@user911747: I use them for some small project, so for me both of them are good.
I found minixml to be super easy to get started.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.