/*
    gcc -o reader reader.c `pkg-config --cflags --libs libxml-2.0`
*/

#include <libxml/xmlreader.h>

int main(void)
{
    xmlTextReaderPtr reader;
    int ret;
    int type;

    reader = xmlReaderForFile("cdata-min.xml", NULL, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER);
    ret = xmlTextReaderRead(reader);
    while (ret == 1 && XML_READER_TYPE_ELEMENT != xmlTextReaderNodeType(reader))
        ret = xmlTextReaderRead(reader);
    xmlFreeTextReader(reader);

    return 0;
}
