/*
* testSchemas.c : a small tester program for Schema validation
*
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*/
#include "libxml.h"
#ifdef LIBXML_SCHEMAS_ENABLED
#include <libxml/xmlversion.h>
#include <stdio.h>
#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_SYS_MMAN_H
/* seems needed for Solaris */
#ifndef MAP_FAILED
#endif
#endif
#include <libxml/xmlmemory.h>
#include <libxml/debugXML.h>
#include <libxml/xmlschemas.h>
#include <libxml/xmlschemastypes.h>
#ifdef LIBXML_DEBUG_ENABLED
static int debug = 0;
#endif
static int noout = 0;
#ifdef HAVE_SYS_MMAN_H
static int memory = 0;
#endif
int i;
int files = 0;
for (i = 1; i < argc ; i++) {
#ifdef LIBXML_DEBUG_ENABLED
debug++;
else
#endif
#ifdef HAVE_SYS_MMAN_H
memory++;
} else
#endif
noout++;
}
}
for (i = 1; i < argc ; i++) {
if (argv[i][0] != '-') {
#ifdef HAVE_SYS_MMAN_H
if (memory) {
int fd;
const char *base;
break;
break;
MAP_SHARED, fd, 0) ;
if (base == (void *) MAP_FAILED)
break;
stderr);
} else
#endif
{
stderr);
}
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef LIBXML_DEBUG_ENABLED
if (debug)
#endif
#endif /* LIBXML_OUTPUT_ENABLED */
goto failed_schemas;
} else {
} else {
int ret;
stderr);
if (ret == 0) {
} else if (ret > 0) {
} else {
printf("%s validation generated an internal error\n",
argv[i]);
}
}
}
files ++;
}
}
if (files == 0) {
printf("Usage : %s [--debug] [--noout] schemas XMLfiles ...\n",
argv[0]);
printf("\tParse the HTML files and output the result of the parsing\n");
#ifdef LIBXML_DEBUG_ENABLED
printf("\t--debug : dump a debug tree of the in-memory document\n");
#endif
printf("\t--noout : do not print the result\n");
#ifdef HAVE_SYS_MMAN_H
printf("\t--memory : test the schemas in memory parsing\n");
#endif
}
return(0);
}
#else
#include <stdio.h>
return(0);
}
#endif /* LIBXML_SCHEMAS_ENABLED */