From 7c44e100628b70719a24b6ff97adbd28460564b9 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sun, 4 Sep 2016 21:09:57 +0200 Subject: Add the .c file --- ezxml.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ezxml.c diff --git a/ezxml.c b/ezxml.c new file mode 100644 index 0000000..0057890 --- /dev/null +++ b/ezxml.c @@ -0,0 +1,28 @@ +#include +#include + +#include "ezxmllib.h" + +int process(char *fn) { + ezxml_t ezdoc = ezxml_parse_file(fn); + if (ezdoc) { + printf("Got a document\n"); + } + + ezxml_t title = ezxml_get(ezdoc, "article-meta", 0, "title-group", 0, "article-title", 0, -1); + if (title) { + printf("title: %s", title->txt); + } + + return 0; +} + +int main(int argc, char *argv[]) { + + for (int i = 0; i < argc; i++) { + process(argv[i]); + } + + return 0; +} + -- cgit v1.2.3