XML parser
==========
Dependencies
------------
- C compiler (C99 expected).
Features
--------
- Relatively small parser.
- Pretty simple API comparable with libexpat.
- Pretty fast.
- Portable
- No dynamic memory allocation.
Supports
--------
- Tags in short-form ().
- Tag attributes.
- Short attributes without an explicity set value ().
- Comments
- CDATA sections.
- Helper function (xml_entitytostr) to convert XML 1.0 / HTML 2.0 named entities
and numeric entities to UTF-8.
- Reading XML from a fd, string buffer or implement a custom reader:
see: XMLParser.getnext and XMLParser.getnext_data.
Caveats
-------
- It is not a compliant XML parser.
- The XML is not checked for errors so it will continue parsing XML data, this
is by design.
- Internally fixed-size buffers are used, callbacks like XMLParser.xmldata are
called multiple times for the same tag if the data size is bigger than the
internal buffer size (sizeof(XMLParser.data)). To differentiate between new
calls for data you can use the xml*start and xml*end handlers.
- The XML specification has no limits on tag and attribute names. For
simplicity/sanity sake this XML parser takes some liberties. Tag and
attribute names are truncated.
Files used
----------
xml.c and xml.h
Interface / API
---------------
Should be trivial, see xml.c and xml.h and the examples below.
Examples
--------
sfeed_opml_import.c or sfeed_web.c or sfeed_xmlenc.c
License
-------
ISC, see LICENSE file.