diff options
author | Aron Xu <aron@debian.org> | 2012-09-18 01:15:22 +0800 |
---|---|---|
committer | Aron Xu <aron@debian.org> | 2012-09-18 01:15:22 +0800 |
commit | f660f9d2924c7549bc87e7f9b4ece7c9727b3682 (patch) | |
tree | 816b3ef0e89d1601803b5dc1b90b50ade0567043 /xmllint.c | |
parent | d7372d053bbd1d58216fbb04d1771ffa4cc3e624 (diff) | |
download | libxml2-f660f9d2924c7549bc87e7f9b4ece7c9727b3682.tar.gz |
Imported Upstream version 2.9.0upstream/2.9.0
Diffstat (limited to 'xmllint.c')
-rw-r--r-- | xmllint.c | 28 |
1 files changed, 15 insertions, 13 deletions
@@ -169,7 +169,7 @@ static int nodefdtd = 0; #ifdef LIBXML_PUSH_ENABLED static int push = 0; #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP static int memory = 0; #endif static int testIO = 0; @@ -209,7 +209,7 @@ static xmlStreamCtxtPtr patstream = NULL; #ifdef LIBXML_XPATH_ENABLED static const char *xpathquery = NULL; #endif -static int options = XML_PARSE_COMPACT; +static int options = XML_PARSE_COMPACT | XML_PARSE_BIG_LINES; static int sax = 0; static int oldxml10 = 0; @@ -1669,6 +1669,7 @@ testSAX(const char *filename) { (xmlSchemaValidityErrorFunc) fprintf, (xmlSchemaValidityWarningFunc) fprintf, stderr); + xmlSchemaValidateSetFilename(vctxt, filename); ret = xmlSchemaValidateStream(vctxt, buf, 0, handler, (void *)user_data); @@ -1823,7 +1824,7 @@ static void processNode(xmlTextReaderPtr reader) { static void streamFile(char *filename) { xmlTextReaderPtr reader; int ret; -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP int fd = -1; struct stat info; const char *base = NULL; @@ -1974,7 +1975,7 @@ static void streamFile(char *filename) { patstream = NULL; } #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if (memory) { xmlFreeParserInputBuffer(input); munmap((char *) base, info.st_size); @@ -2139,7 +2140,7 @@ static void doXPathQuery(xmlDocPtr doc, const char *query) { progresult = XMLLINT_ERR_MEM; return; } - ctxt->node = xmlDocGetRootElement(doc); + ctxt->node = (xmlNodePtr) doc; res = xmlXPathEval(BAD_CAST query, ctxt); xmlXPathFreeContext(ctxt); @@ -2212,7 +2213,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { } } #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP else if ((html) && (memory)) { int fd; struct stat info; @@ -2327,7 +2328,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { if (rectxt == NULL) xmlFreeParserCtxt(ctxt); } -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP } else if (memory) { int fd; struct stat info; @@ -2591,7 +2592,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { } } else #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP if (memory) { xmlChar *result; int len; @@ -2619,7 +2620,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { } } else -#endif /* HAVE_SYS_MMAN_H */ +#endif /* HAVE_MMAP */ if (compress) { xmlSaveFile(output ? output : "-", doc); } else if (oldout) { @@ -3017,7 +3018,7 @@ static void usage(const char *name) { #ifdef LIBXML_PUSH_ENABLED printf("\t--push : use the push mode of the parser\n"); #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP printf("\t--memory : parse from memory\n"); #endif printf("\t--maxmem nbbytes : limits memory allocation to nbbytes bytes\n"); @@ -3247,7 +3248,7 @@ main(int argc, char **argv) { (!strcmp(argv[i], "--push"))) push++; #endif /* LIBXML_PUSH_ENABLED */ -#ifdef HAVE_SYS_MMAN_H +#ifdef HAVE_MMAP else if ((!strcmp(argv[i], "-memory")) || (!strcmp(argv[i], "--memory"))) memory++; @@ -3339,8 +3340,9 @@ main(int argc, char **argv) { } else if ((!strcmp(argv[i], "-noblanks")) || (!strcmp(argv[i], "--noblanks"))) { - noblanks++; - xmlKeepBlanksDefault(0); + noblanks++; + xmlKeepBlanksDefault(0); + options |= XML_PARSE_NOBLANKS; } else if ((!strcmp(argv[i], "-maxmem")) || (!strcmp(argv[i], "--maxmem"))) { |