summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2016-09-04 21:09:57 +0200
committerSilvan Jegen <s.jegen@gmail.com>2016-09-04 21:09:57 +0200
commit7c44e100628b70719a24b6ff97adbd28460564b9 (patch)
treeec44984a078d6751e7b05256766cd173758e7667
parent98a100d547ee80473b96790305dd7e4ae126d67f (diff)
Add the .c file
-rw-r--r--ezxml.c28
1 files changed, 28 insertions, 0 deletions
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 <stdio.h>
+#include <stdlib.h>
+
+#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;
+}
+