/*
* testSAX.c : a small tester program for parsing using the SAX API.
*
* See Copyright for the status of this software.
*
* daniel@veillard.com
*/
#include "libxml.h"
#ifdef LIBXML_READER_ENABLED
#include <string.h>
#include <stdarg.h>
#ifdef HAVE_SYS_TYPES_H
#endif
#ifdef HAVE_SYS_STAT_H
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <libxml/xmlreader.h>
static int debug = 0;
static int dump = 0;
static int noent = 0;
static int count = 0;
static int valid = 0;
static int consumed = 0;
printf("\tParse the XML files using the xmlTextReader API\n");
printf("\t --count: count the number of attribute and elements\n");
printf("\t --valid: validate the document\n");
printf("\t --consumed: count the number of bytes consumed\n");
exit(1);
}
int type;
if (count) {
if (type == 1) {
elem++;
}
}
}
int ret;
if (count) {
elem = 0;
attrs = 0;
}
if (valid)
/*
* Process all nodes in sequence
*/
while (ret == 1) {
}
/*
* Done, cleanup and status
*/
if (consumed)
if (ret != 0) {
} else if (count)
} else {
}
}
int i;
int files = 0;
if (argc <= 1) {
return(1);
}
for (i = 1; i < argc ; i++) {
debug++;
dump++;
count++;
consumed++;
valid++;
noent++;
}
for (i = 1; i < argc ; i++) {
if (argv[i][0] != '-') {
handleFile(argv[i]);
files ++;
}
}
return(0);
}
#else
return(0);
}
#endif /* LIBXML_READER_ENABLED */