昨日の続き。 結局、パーサは使い慣れたlibxml2。libxml2はDOMしか使っていなかったけど、SAXだとこんな感じ。 #include <libxml/SAX.h> #include <string.h> void OnStartElement(void* ctx, const xmlChar* name, const xmlChar** atts); void OnEndElement(void * ctx, const xmlChar * name); void OnCharacters(void* ctx, const xmlChar * ch, int len); void OnStartDocument(void * ctx); void OnEndDocument(void * ctx); int main(int argc, char*