summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ezxml.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ezxml.c b/ezxml.c
index c981bb2..f4e9d18 100644
--- a/ezxml.c
+++ b/ezxml.c
@@ -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;
}