summaryrefslogtreecommitdiff
path: root/ezxml.c
blob: c981bb24614557730b106aaa07a635727d7cd719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include <stdlib.h>

#include "ezxmllib.h"

int process(char *fn) {
	ezxml_t ezdoc = ezxml_parse_file(fn);
	if (!ezdoc) {
		printf("Error when parsing file.\n");
	}

	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);
	}

	return 0;
}

int main(int argc, char *argv[]) {

	for (int i = 1; i < argc; i++) {
		process(argv[i]);
	}

	return 0;
}