version 1.15, 2000/09/22 16:05:34
|
version 1.16, 2000/10/11 13:39:35
|
Line 67 static int noout = 0;
|
Line 67 static int noout = 0;
|
static int nowrap = 0; |
static int nowrap = 0; |
static int valid = 0; |
static int valid = 0; |
static int postvalid = 0; |
static int postvalid = 0; |
|
static char * dtdvalid = NULL; |
static int repeat = 0; |
static int repeat = 0; |
static int insert = 0; |
static int insert = 0; |
static int compress = 0; |
static int compress = 0; |
Line 562 void parseAndPrintFile(char *filename) {
|
Line 563 void parseAndPrintFile(char *filename) {
|
/* |
/* |
* A posteriori validation test |
* A posteriori validation test |
*/ |
*/ |
if (postvalid) { |
if (dtdvalid != NULL) { |
|
xmlDtdPtr dtd; |
|
|
|
dtd = xmlParseDTD(NULL, (const xmlChar *)dtdvalid); |
|
if (dtd == NULL) { |
|
fprintf(stderr, "Could not parse DTD %s\n", dtdvalid); |
|
} else { |
|
xmlValidCtxt cvp; |
|
cvp.userData = (void *) stderr; cvp.error = (xmlValidityErrorFunc) fprintf; cvp.warning = (xmlValidityWarningFunc) fprintf; |
|
xmlValidateDtd(&cvp, doc, dtd); |
|
} |
|
} else if (postvalid) { |
xmlValidCtxt cvp; |
xmlValidCtxt cvp; |
cvp.userData = (void *) stderr; cvp.error = (xmlValidityErrorFunc) fprintf; cvp.warning = (xmlValidityWarningFunc) fprintf; |
cvp.userData = (void *) stderr; cvp.error = (xmlValidityErrorFunc) fprintf; cvp.warning = (xmlValidityWarningFunc) fprintf; |
xmlValidateDocument(&cvp, doc); |
xmlValidateDocument(&cvp, doc); |
Line 623 int main(int argc, char **argv) {
|
Line 635 int main(int argc, char **argv) {
|
else if ((!strcmp(argv[i], "-postvalid")) || |
else if ((!strcmp(argv[i], "-postvalid")) || |
(!strcmp(argv[i], "--postvalid"))) |
(!strcmp(argv[i], "--postvalid"))) |
postvalid++; |
postvalid++; |
|
else if ((!strcmp(argv[i], "-dtdvalid")) || |
|
(!strcmp(argv[i], "--dtdvalid"))) { |
|
i++; |
|
dtdvalid = argv[i]; |
|
} |
else if ((!strcmp(argv[i], "-insert")) || |
else if ((!strcmp(argv[i], "-insert")) || |
(!strcmp(argv[i], "--insert"))) |
(!strcmp(argv[i], "--insert"))) |
insert++; |
insert++; |
Line 725 int main(int argc, char **argv) {
|
Line 742 int main(int argc, char **argv) {
|
printf("\t--nowarp : do not put HTML doc wrapper\n"); |
printf("\t--nowarp : do not put HTML doc wrapper\n"); |
printf("\t--valid : validate the document in addition to std well-formed check\n"); |
printf("\t--valid : validate the document in addition to std well-formed check\n"); |
printf("\t--postvalid : do a posteriori validation, i.e after parsing\n"); |
printf("\t--postvalid : do a posteriori validation, i.e after parsing\n"); |
|
printf("\t--dtdvalid URL : do a posteriori validation against a given DTD\n"); |
printf("\t--repeat : repeat 100 times, for timing or profiling\n"); |
printf("\t--repeat : repeat 100 times, for timing or profiling\n"); |
printf("\t--insert : ad-hoc test for valid insertions\n"); |
printf("\t--insert : ad-hoc test for valid insertions\n"); |
printf("\t--compress : turn on gzip compression of output\n"); |
printf("\t--compress : turn on gzip compression of output\n"); |