summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2016-09-04 21:26:36 +0200
committerSilvan Jegen <s.jegen@gmail.com>2016-09-04 21:26:36 +0200
commit3fec4606d27a1d9e41a40bb89060494763f9978b (patch)
treed4d192a7d5ceb9455b93f41737e11cf200129035
parentb2134c3e65938f96f3e1d631b2cee793cb27d298 (diff)
Specify the complete path
-rw-r--r--ezxml.c8
1 files 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;