diff options
-rw-r--r-- | ezxml.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -11,9 +11,19 @@ int process(char *fn) { ezxml_t title = ezxml_get(ezdoc, "front", 0, "article-meta", 0, "title-group", 0, "article-title", -1); if (title) { - printf("title: %s\n", title->txt); + printf("article-title: %s\n", title->txt); } + ezxml_t body = ezxml_get(ezdoc, "body", -1); + if (!body) { + fprintf(stderr, "body not found\n"); + } + for (ezxml_t c = ezxml_child(body, "sec"); c; c = c->next) { + ezxml_t t = ezxml_get(c, "title", -1); + printf("t: %s\n", t->txt); + } + + printf("\n"); return 0; } |