sfeed

Simple RSS and Atom feed parser
git clone https://git.sinitax.com/codemadness/sfeed
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

README.xml (2082B)


      1XML parser
      2----------
      3
      4A small XML parser.
      5
      6For the original version see:
      7https://git.codemadness.org/xmlparser/
      8
      9
     10Dependencies
     11------------
     12
     13- C compiler (ANSI).
     14
     15
     16Features
     17--------
     18
     19- Relatively small parser.
     20- Pretty simple API.
     21- Pretty fast.
     22- Portable
     23- No dynamic memory allocation.
     24
     25
     26Supports
     27--------
     28
     29- Tags in short-form (<img src="lolcat.jpg" title="Meow" />).
     30- Tag attributes.
     31- Short attributes without an explicitly set value (<input type="checkbox" checked />).
     32- Comments
     33- CDATA sections.
     34- Helper function (xml_entitytostr) to convert XML 1.0 / HTML 2.0 named entities
     35  and numeric entities to UTF-8.
     36- Reading XML from a fd, string buffer or implement a custom reader:
     37  see: XMLParser.getnext or GETNEXT() macro.
     38
     39
     40Caveats
     41-------
     42
     43- It is not a compliant XML parser.
     44- Performance: data is buffered even if a handler is not set: to make parsing
     45  faster change this code from xml.c.
     46- The XML is not checked for errors so it will continue parsing XML data, this
     47  is by design.
     48- Internally fixed-size buffers are used, callbacks like XMLParser.xmldata are
     49  called multiple times for the same tag if the data size is bigger than the
     50  internal buffer size (sizeof(XMLParser.data)). To differentiate between new
     51  calls for data you can use the xml*start and xml*end handlers.
     52- It does not handle XML white-space rules for tag data. The raw values
     53  including white-space is passed. This is useful in some cases, like for
     54  HTML <pre> tags.
     55- The XML specification has no limits on tag and attribute names. For
     56  simplicity/sanity sake this XML parser takes some liberties. Tag and
     57  attribute names are truncated if they are excessively long.
     58- Entity expansions are not parsed as well as DOCTYPE, ATTLIST etc.
     59
     60
     61Files used
     62----------
     63
     64xml.c and xml.h
     65
     66
     67Interface / API
     68---------------
     69
     70Should be trivial, see xml.c and xml.h and the examples below.
     71
     72
     73Examples
     74--------
     75
     76sfeed_opml_import.c or sfeed_web.c or sfeed_xmlenc.c
     77
     78See skeleton.c in the original xmlparser repository for a base program to start
     79quickly.
     80
     81
     82License
     83-------
     84
     85ISC, see LICENSE file.