diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2016-09-05 19:07:39 +0200 |
---|---|---|
committer | Silvan Jegen <s.jegen@gmail.com> | 2016-09-05 19:07:39 +0200 |
commit | 6fef5e077a3a5687b335be1260bc030661326c07 (patch) | |
tree | 3bfa5f4b81110b4911709cc77a80e927b74d55f0 | |
parent | 3fec4606d27a1d9e41a40bb89060494763f9978b (diff) |
Print titles
-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; } |