5

What is the preferred library for parsing XML data in Pure C?

1
  • the libraries sugested are good but I have created my own simple xml parser after a few problems with Expat Commented Jan 31, 2011 at 16:47

6 Answers 6

13

The canonical XML parsing library for C is libxml2.

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

1 Comment

Which is released under a very liberal license. It's also extremely portable and well tested.
5

Two popular choices are expat and libxml2.

Comments

2

Here is a list of libraries for multiple languages, including C:

http://www.xml.com/pub/rg/XML_Parsers

Comments

1

Not 'the preferred library', but there's also http://www.minixml.org/.

Mini-XML is a small XML library that you can use to read and write XML and XML-like data files in your application without requiring large non-standard libraries. Mini-XML only requires an ANSI C compatible compiler (GCC works, as do most vendors' ANSI C compilers) and a 'make' program.

Mini-XML supports reading of UTF-8 and UTF-16 and writing of UTF-8 encoded XML files and strings. Data is stored in a linked-list tree structure, preserving the XML data hierarchy, and arbitrary element names, attributes, and attribute values are supported with no preset limits, just available memory.

Comments

0

You can consider miniML-Parser, a simple and tiny XML parser library in C. It is specifically developed for embedded applications in mind.

  • It is extremely easy to use: You need to call only one API to parse your XML data
  • It has a very small footprint: The parser uses only 1.8 kB1 of code memory. Hence, you can use it in very small embedded applications.
  • It is a validating XML parser.
  • It also extracts the content of XML data and converts it to its specified data type.
  • It comes with a tool to generate the source code from XML schema file, instead of manually writing XML tree structure in C.

Disclosure: I'm author of this miniML-Parser

Comments

-1

VTD-XML is the one you should look into, if you want a combination of ease of use, performane and efficiency

1 Comment

library appears to be java based, not pure "C".

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.