xmlparser

XML parser
git clone git://git.codemadness.org/xmlparser
Log | Files | Refs | README | LICENSE

README (1438B)


      1 XML parser
      2 ==========
      3 
      4 
      5 Dependencies
      6 ------------
      7 
      8 - C compiler (C99 expected).
      9 
     10 
     11 Features
     12 --------
     13 
     14 - Relatively small parser.
     15 - Pretty simple API.
     16 - Pretty fast.
     17 - Portable
     18 - No dynamic memory allocation.
     19 
     20 
     21 Supports
     22 --------
     23 
     24 - Tags in short-form (<img src="lolcat.jpg" title="Meow" />).
     25 - Tag attributes.
     26 - Short attributes without an explicity set value (<input type="checkbox" checked />).
     27 - Comments
     28 - CDATA sections.
     29 - Helper function (xml_entitytostr) to convert XML 1.0 / HTML 2.0 named entities
     30   and numeric entities to UTF-8.
     31 - Reading XML from a fd, string buffer or implement a custom reader:
     32   see: XMLParser.getnext.
     33 
     34 
     35 Caveats
     36 -------
     37 
     38 - It is not a compliant XML parser.
     39 - The XML is not checked for errors so it will continue parsing XML data, this
     40   is by design.
     41 - Internally fixed-size buffers are used, callbacks like XMLParser.xmldata are
     42   called multiple times for the same tag if the data size is bigger than the
     43   internal buffer size (sizeof(XMLParser.data)). To differentiate between new
     44   calls for data you can use the xml*start and xml*end handlers.
     45 - The XML specification has no limits on tag and attribute names. For
     46   simplicity/sanity sake this XML parser takes some liberties. Tag and
     47   attribute names are truncated.
     48 
     49 
     50 Files used
     51 ----------
     52 
     53 xml.c and xml.h
     54 
     55 
     56 Interface / API
     57 ---------------
     58 
     59 Should be trivial, see xml.c and xml.h and the examples below.
     60 
     61 
     62 License
     63 -------
     64 
     65 ISC, see LICENSE file.
     66