From 3fec4606d27a1d9e41a40bb89060494763f9978b Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sun, 4 Sep 2016 21:26:36 +0200 Subject: Specify the complete path --- ezxml.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ezxml.c b/ezxml.c index 952b24d..c981bb2 100644 --- a/ezxml.c +++ b/ezxml.c @@ -5,13 +5,13 @@ int process(char *fn) { ezxml_t ezdoc = ezxml_parse_file(fn); - if (ezdoc) { - printf("Got a document\n"); + if (!ezdoc) { + printf("Error when parsing file.\n"); } - ezxml_t title = ezxml_get(ezdoc, "article-meta", 0, "title-group", 0, "article-title", 0, -1); + ezxml_t title = ezxml_get(ezdoc, "front", 0, "article-meta", 0, "title-group", 0, "article-title", -1); if (title) { - printf("title: %s", title->txt); + printf("title: %s\n", title->txt); } return 0; -- cgit v1.2.1-18-gbd029