4 ms·
libxml2 can be massive overkill if you just want to parse XML data. Unless you need schema validation and namespaces and all that jazz, you can parse XML in C w
by maskros 4y ago
libxml2 can be massive overkill if you just want to parse XML data. Unless you need schema validation and namespaces and all that jazz, you can parse XML in C with a simple state machine of ~200 lines. Add another 200 to build a DOM-like structure.
https://github.com/ccxvii/snippets/blob/master/xml.c#L326 https://github.com/ccxvii/snippets/blob/master/xml.c#L326
Or in lua with ~200 lines altogether:
https://github.com/ccxvii/snippets/blob/master/xml.lua https://github.com/ccxvii/snippets/blob/master/xml.lua