about examples download fun ;-)
about

ixemolla is a small SAX-like XML parser writen in plain ANSI C.
If you need a complete XML parser, ixemolla is not the right choice. However, if you need a simple XML reader, ixemolla could be one of the right choices.

ixemolla analyzes an XML stream and generate callbacks for elements start, elements end, attributes names, attributes values, contents, CDATA sections, comments, processing instructions.
The parser handle mixed contents and support fundamental contents decoding.

The ixemolla source code fit just 200 lines of code.
Section Fun ;-) shows how small are ixemolla sources

ixemolla project is under GNU General Public License, so you have to read and agree the license before continue.

examples

This is a simple example that, for each element, print its name.

int print(int type, char *start, char *end, int needconv, void *usr) 
{
    ptrdiff_t len=end-start;
    if (IXET_START!=type)
        return 0;
    fwrite(text, end-start, 1, stdout);
    printf("\n");
    return 0;
}
int example() 
{
    IxeInfo ei;
    int err;
    err=ixemolla(xmlSource, &print, 0, &ei);
    if (err)
        printf("error at line %d, column %d\n", ei.line, ei.column);
    return err;
}

Next example show how encoded contents can be decoded. The parameter needconvis set to one each time text need convertion.
This function replace print function callback.

int decode(int type, char *start, char *end, int needconv, void *usr) 
{
    ptrdiff_t len=end-start;
    char *decoded;
    int err;
    if (IXET_CONTENT!=type || !needconv)
        return 0;
    decoded=(char*)malloc(len+1);
    err=ixedecode(text, len, to);
    if (err)
        return err;
    printf("%s\n", decoded);
    free(decoded);
    return 0;
}
download

ixemolla project is hosted from SourceForge. This is the project homepage.
To download the project use SVN tool:

svn co https://ixemolla.svn.sourceforge.net/svnroot/ixemolla ixemolla

Add '/trunk' to the HTTPS URL above to check out only trunk (main development line).

fun ;-)

This is an obfuscated version of the ixemolla beta1 source code; Only comments, spaces and CR have been removed:

Get source code and try ixemolla! :-D

SourceForge.net Logo