Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsing XML in Pure C

Tags:

c

xml

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

like image 795
Mike Avatar asked Jan 31 '11 00:01

Mike


4 Answers

The canonical XML parsing library for C is libxml2.

like image 164
Lily Ballard Avatar answered Oct 23 '22 03:10

Lily Ballard


Two popular choices are expat and libxml2.

like image 5
Greg Hewgill Avatar answered Oct 23 '22 03:10

Greg Hewgill


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

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

like image 2
jmort253 Avatar answered Oct 23 '22 03:10

jmort253


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.

like image 1
x-x Avatar answered Oct 23 '22 03:10

x-x