blob: 18805f726e1b598b2aea6019d8ec28fdc01bc783 [file] [log] [blame]
Daniel Veillardce8b83b2000-04-05 18:38:42 +00001/*
2 * xmllint.c : a small tester program for XML input.
3 *
4 * See Copyright for the status of this software.
5 *
6 * Daniel.Veillard@w3.org
7 */
8
9#ifdef WIN32
10#include "win32config.h"
11#else
12#include "config.h"
13#endif
14
15#include <stdio.h>
16#include <string.h>
17#include <stdio.h>
18#include <stdarg.h>
19
20#ifdef HAVE_SYS_TYPES_H
21#include <sys/types.h>
22#endif
23#ifdef HAVE_SYS_STAT_H
24#include <sys/stat.h>
25#endif
26#ifdef HAVE_FCNTL_H
27#include <fcntl.h>
28#endif
29#ifdef HAVE_UNISTD_H
30#include <unistd.h>
31#endif
Daniel Veillard46e370e2000-07-21 20:32:03 +000032#ifdef HAVE_SYS_MMAN_H
33#include <sys/mman.h>
34#endif
Daniel Veillardce8b83b2000-04-05 18:38:42 +000035#ifdef HAVE_STDLIB_H
36#include <stdlib.h>
37#endif
38#ifdef HAVE_LIBREADLINE
39#include <readline/readline.h>
40#ifdef HAVE_LIBHISTORY
41#include <readline/history.h>
42#endif
43#endif
44
45#include <libxml/xmlmemory.h>
46#include <libxml/parser.h>
47#include <libxml/parserInternals.h>
48#include <libxml/HTMLparser.h>
49#include <libxml/HTMLtree.h>
50#include <libxml/tree.h>
51#include <libxml/xpath.h>
52#include <libxml/debugXML.h>
53
54#ifdef LIBXML_DEBUG_ENABLED
55static int debug = 0;
56static int shell = 0;
57static int debugent = 0;
58#endif
59static int copy = 0;
60static int recovery = 0;
61static int noent = 0;
62static int noout = 0;
63static int nowrap = 0;
64static int valid = 0;
65static int postvalid = 0;
66static int repeat = 0;
67static int insert = 0;
68static int compress = 0;
69static int html = 0;
70static int htmlout = 0;
71static int push = 0;
Daniel Veillard46e370e2000-07-21 20:32:03 +000072#ifdef HAVE_SYS_MMAN_H
73static int memory = 0;
74#endif
Daniel Veillardce8b83b2000-04-05 18:38:42 +000075static int noblanks = 0;
Daniel Veillard5e873c42000-04-12 13:27:38 +000076static int testIO = 0;
Daniel Veillardbe803962000-06-28 23:40:59 +000077static char *encoding = NULL;
Daniel Veillardce8b83b2000-04-05 18:38:42 +000078
79extern int xmlDoValidityCheckingDefaultValue;
80extern int xmlGetWarningsDefaultValue;
81
82/************************************************************************
83 * *
84 * HTML ouput *
85 * *
86 ************************************************************************/
87char buffer[50000];
88
89void
90xmlHTMLEncodeSend(void) {
91 char *result;
92
93 result = (char *) xmlEncodeEntitiesReentrant(NULL, BAD_CAST buffer);
94 if (result) {
95 fprintf(stderr, "%s", result);
96 xmlFree(result);
97 }
98 buffer[0] = 0;
99}
100
101/**
102 * xmlHTMLPrintFileInfo:
103 * @input: an xmlParserInputPtr input
104 *
105 * Displays the associated file and line informations for the current input
106 */
107
108void
109xmlHTMLPrintFileInfo(xmlParserInputPtr input) {
110 fprintf(stderr, "<p>");
111 if (input != NULL) {
112 if (input->filename) {
113 sprintf(&buffer[strlen(buffer)], "%s:%d: ", input->filename,
114 input->line);
115 } else {
116 sprintf(&buffer[strlen(buffer)], "Entity: line %d: ", input->line);
117 }
118 }
119 xmlHTMLEncodeSend();
120}
121
122/**
123 * xmlHTMLPrintFileContext:
124 * @input: an xmlParserInputPtr input
125 *
126 * Displays current context within the input content for error tracking
127 */
128
129void
130xmlHTMLPrintFileContext(xmlParserInputPtr input) {
131 const xmlChar *cur, *base;
132 int n;
133
134 if (input == NULL) return;
135 fprintf(stderr, "<pre>\n");
136 cur = input->cur;
137 base = input->base;
138 while ((cur > base) && ((*cur == '\n') || (*cur == '\r'))) {
139 cur--;
140 }
141 n = 0;
142 while ((n++ < 80) && (cur > base) && (*cur != '\n') && (*cur != '\r'))
143 cur--;
144 if ((*cur == '\n') || (*cur == '\r')) cur++;
145 base = cur;
146 n = 0;
147 while ((*cur != 0) && (*cur != '\n') && (*cur != '\r') && (n < 79)) {
148 sprintf(&buffer[strlen(buffer)], "%c", (unsigned char) *cur++);
149 n++;
150 }
151 sprintf(&buffer[strlen(buffer)], "\n");
152 cur = input->cur;
153 while ((*cur == '\n') || (*cur == '\r'))
154 cur--;
155 n = 0;
156 while ((cur != base) && (n++ < 80)) {
157 sprintf(&buffer[strlen(buffer)], " ");
158 base++;
159 }
160 sprintf(&buffer[strlen(buffer)],"^\n");
161 xmlHTMLEncodeSend();
162 fprintf(stderr, "</pre>");
163}
164
165/**
166 * xmlHTMLError:
167 * @ctx: an XML parser context
168 * @msg: the message to display/transmit
169 * @...: extra parameters for the message display
170 *
171 * Display and format an error messages, gives file, line, position and
172 * extra parameters.
173 */
174void
175xmlHTMLError(void *ctx, const char *msg, ...)
176{
177 xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
178 xmlParserInputPtr input;
179 xmlParserInputPtr cur = NULL;
180 va_list args;
181
182 buffer[0] = 0;
183 input = ctxt->input;
184 if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) {
185 cur = input;
186 input = ctxt->inputTab[ctxt->inputNr - 2];
187 }
188
189 xmlHTMLPrintFileInfo(input);
190
191 fprintf(stderr, "<b>error</b>: ");
192 va_start(args, msg);
193 vsprintf(&buffer[strlen(buffer)], msg, args);
194 va_end(args);
195 xmlHTMLEncodeSend();
196 fprintf(stderr, "</p>\n");
197
198 xmlHTMLPrintFileContext(input);
199 xmlHTMLEncodeSend();
200}
201
202/**
203 * xmlHTMLWarning:
204 * @ctx: an XML parser context
205 * @msg: the message to display/transmit
206 * @...: extra parameters for the message display
207 *
208 * Display and format a warning messages, gives file, line, position and
209 * extra parameters.
210 */
211void
212xmlHTMLWarning(void *ctx, const char *msg, ...)
213{
214 xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
215 xmlParserInputPtr input;
216 xmlParserInputPtr cur = NULL;
217 va_list args;
218
219 buffer[0] = 0;
220 input = ctxt->input;
221 if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) {
222 cur = input;
223 input = ctxt->inputTab[ctxt->inputNr - 2];
224 }
225
226
227 xmlHTMLPrintFileInfo(input);
228
229 fprintf(stderr, "<b>warning</b>: ");
230 va_start(args, msg);
231 vsprintf(&buffer[strlen(buffer)], msg, args);
232 va_end(args);
233 xmlHTMLEncodeSend();
234 fprintf(stderr, "</p>\n");
235
236 xmlHTMLPrintFileContext(input);
237 xmlHTMLEncodeSend();
238}
239
240/**
241 * xmlHTMLValidityError:
242 * @ctx: an XML parser context
243 * @msg: the message to display/transmit
244 * @...: extra parameters for the message display
245 *
246 * Display and format an validity error messages, gives file,
247 * line, position and extra parameters.
248 */
249void
250xmlHTMLValidityError(void *ctx, const char *msg, ...)
251{
252 xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
253 xmlParserInputPtr input;
254 va_list args;
255
256 buffer[0] = 0;
257 input = ctxt->input;
258 if ((input->filename == NULL) && (ctxt->inputNr > 1))
259 input = ctxt->inputTab[ctxt->inputNr - 2];
260
261 xmlHTMLPrintFileInfo(input);
262
263 fprintf(stderr, "<b>validity error</b>: ");
264 va_start(args, msg);
265 vsprintf(&buffer[strlen(buffer)], msg, args);
266 va_end(args);
267 xmlHTMLEncodeSend();
268 fprintf(stderr, "</p>\n");
269
270 xmlHTMLPrintFileContext(input);
271 xmlHTMLEncodeSend();
272}
273
274/**
275 * xmlHTMLValidityWarning:
276 * @ctx: an XML parser context
277 * @msg: the message to display/transmit
278 * @...: extra parameters for the message display
279 *
280 * Display and format a validity warning messages, gives file, line,
281 * position and extra parameters.
282 */
283void
284xmlHTMLValidityWarning(void *ctx, const char *msg, ...)
285{
286 xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
287 xmlParserInputPtr input;
288 va_list args;
289
290 buffer[0] = 0;
291 input = ctxt->input;
292 if ((input->filename == NULL) && (ctxt->inputNr > 1))
293 input = ctxt->inputTab[ctxt->inputNr - 2];
294
295 xmlHTMLPrintFileInfo(input);
296
297 fprintf(stderr, "<b>validity warning</b>: ");
298 va_start(args, msg);
299 vsprintf(&buffer[strlen(buffer)], msg, args);
300 va_end(args);
301 xmlHTMLEncodeSend();
302 fprintf(stderr, "</p>\n");
303
304 xmlHTMLPrintFileContext(input);
305 xmlHTMLEncodeSend();
306}
307
308/************************************************************************
309 * *
310 * Shell Interface *
311 * *
312 ************************************************************************/
313/**
314 * xmlShellReadline:
315 * @prompt: the prompt value
316 *
317 * Read a string
318 *
319 * Returns a pointer to it or NULL on EOF the caller is expected to
320 * free the returned string.
321 */
322char *
323xmlShellReadline(char *prompt) {
324#ifdef HAVE_LIBREADLINE
325 char *line_read;
326
327 /* Get a line from the user. */
328 line_read = readline (prompt);
329
330 /* If the line has any text in it, save it on the history. */
331 if (line_read && *line_read)
332 add_history (line_read);
333
334 return (line_read);
335#else
336 char line_read[501];
337
338 if (prompt != NULL)
339 fprintf(stdout, "%s", prompt);
340 if (!fgets(line_read, 500, stdin))
341 return(NULL);
342 line_read[500] = 0;
343 return(strdup(line_read));
344#endif
345}
346
347/************************************************************************
348 * *
Daniel Veillard5e873c42000-04-12 13:27:38 +0000349 * I/O Interfaces *
350 * *
351 ************************************************************************/
352
353int myRead(FILE *f, char * buffer, int len) {
354 return(fread(buffer, 1, len, f));
355}
356void myClose(FILE *f) {
357 fclose(f);
358}
359
360/************************************************************************
361 * *
Daniel Veillardce8b83b2000-04-05 18:38:42 +0000362 * Test processing *
363 * *
364 ************************************************************************/
365void parseAndPrintFile(char *filename) {
366 xmlDocPtr doc = NULL, tmp;
367
368#ifdef LIBXML_HTML_ENABLED
369 if (html) {
370 doc = htmlParseFile(filename, NULL);
371 } else {
372#endif /* LIBXML_HTML_ENABLED */
373 /*
374 * build an XML tree from a string;
375 */
376 if (push) {
377 FILE *f;
378
379 f = fopen(filename, "r");
380 if (f != NULL) {
381 int res, size = 3;
382 char chars[1024];
383 xmlParserCtxtPtr ctxt;
384
385 if (repeat)
386 size = 1024;
387 res = fread(chars, 1, 4, f);
388 if (res > 0) {
389 ctxt = xmlCreatePushParserCtxt(NULL, NULL,
390 chars, res, filename);
391 while ((res = fread(chars, 1, size, f)) > 0) {
392 xmlParseChunk(ctxt, chars, res, 0);
393 }
394 xmlParseChunk(ctxt, chars, 0, 1);
395 doc = ctxt->myDoc;
396 xmlFreeParserCtxt(ctxt);
397 }
398 }
Daniel Veillard5e873c42000-04-12 13:27:38 +0000399 } else if (testIO) {
400 int ret;
401 FILE *f;
402
403 f = fopen(filename, "r");
404 if (f != NULL) {
405 xmlParserCtxtPtr ctxt;
406
407 ctxt = xmlCreateIOParserCtxt(NULL, NULL,
408 (xmlInputReadCallback) myRead,
409 (xmlInputCloseCallback) myClose,
410 f, XML_CHAR_ENCODING_NONE);
411 xmlParseDocument(ctxt);
412
413 ret = ctxt->wellFormed;
414 doc = ctxt->myDoc;
415 xmlFreeParserCtxt(ctxt);
416 if (!ret) {
417 xmlFreeDoc(doc);
418 doc = NULL;
419 }
420 }
Daniel Veillardce8b83b2000-04-05 18:38:42 +0000421 } else if (recovery) {
422 doc = xmlRecoverFile(filename);
423 } else if (htmlout) {
424 int ret;
425 xmlParserCtxtPtr ctxt;
426 xmlSAXHandler silent, *old;
427
428 ctxt = xmlCreateFileParserCtxt(filename);
429 memcpy(&silent, ctxt->sax, sizeof(silent));
430 old = ctxt->sax;
431 silent.error = xmlHTMLError;
432 if (xmlGetWarningsDefaultValue)
433 silent.warning = xmlHTMLWarning;
434 else
435 silent.warning = NULL;
436 silent.fatalError = xmlHTMLError;
437 ctxt->sax = &silent;
438 ctxt->vctxt.error = xmlHTMLValidityError;
439 if (xmlGetWarningsDefaultValue)
440 ctxt->vctxt.warning = xmlHTMLValidityWarning;
441 else
442 ctxt->vctxt.warning = NULL;
443
444 xmlParseDocument(ctxt);
445
446 ret = ctxt->wellFormed;
447 doc = ctxt->myDoc;
448 ctxt->sax = old;
449 xmlFreeParserCtxt(ctxt);
450 if (!ret) {
451 xmlFreeDoc(doc);
452 doc = NULL;
453 }
Daniel Veillard46e370e2000-07-21 20:32:03 +0000454#ifdef HAVE_SYS_MMAN_H
455 } else if (memory) {
456 int fd;
457 struct stat info;
458 const char *base;
459 if (stat(filename, &info) < 0)
460 return;
461 if ((fd = open(filename, O_RDONLY)) < 0)
462 return;
463 base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
464 if (base == MAP_FAILED)
465 return;
466
467 doc = xmlParseMemory((char *) base, info.st_size);
468 munmap((char *) base, info.st_size);
469#endif
Daniel Veillardce8b83b2000-04-05 18:38:42 +0000470 } else
471 doc = xmlParseFile(filename);
472#ifdef LIBXML_HTML_ENABLED
473 }
474#endif
475
476#ifdef LIBXML_DEBUG_ENABLED
477 /*
478 * shell interraction
479 */
480 if (shell)
481 xmlShell(doc, filename, xmlShellReadline, stdout);
482#endif
483
484 /*
485 * test intermediate copy if needed.
486 */
487 if (copy) {
488 tmp = doc;
489 doc = xmlCopyDoc(doc, 1);
490 xmlFreeDoc(tmp);
491 }
492
493 if ((insert) && (!html)) {
494 const xmlChar* list[256];
495 int nb, i;
496 xmlNodePtr node;
497
498 if (doc->children != NULL) {
499 node = doc->children;
500 while ((node != NULL) && (node->last == NULL)) node = node->next;
501 if (node != NULL) {
502 nb = xmlValidGetValidElements(node->last, NULL, list, 256);
503 if (nb < 0) {
504 printf("could not get valid list of elements\n");
505 } else if (nb == 0) {
506 printf("No element can be indersted under root\n");
507 } else {
508 printf("%d element types can be indersted under root:\n",
509 nb);
510 for (i = 0;i < nb;i++) {
511 printf("%s\n", list[i]);
512 }
513 }
514 }
515 }
516 }else if (noout == 0) {
517 /*
518 * print it.
519 */
520#ifdef LIBXML_DEBUG_ENABLED
521 if (!debug) {
522#endif
523 if (compress)
524 xmlSaveFile("-", doc);
Daniel Veillardbe803962000-06-28 23:40:59 +0000525 else if (encoding != NULL)
526 xmlSaveFileEnc("-", doc, encoding);
Daniel Veillardce8b83b2000-04-05 18:38:42 +0000527 else
528 xmlDocDump(stdout, doc);
529#ifdef LIBXML_DEBUG_ENABLED
530 } else
531 xmlDebugDumpDocument(stdout, doc);
532#endif
533 }
534
535 /*
536 * A posteriori validation test
537 */
538 if (postvalid) {
539 xmlValidCtxt cvp;
540 cvp.userData = (void *) stderr; cvp.error = (xmlValidityErrorFunc) fprintf; cvp.warning = (xmlValidityWarningFunc) fprintf;
541 xmlValidateDocument(&cvp, doc);
542 }
543
544#ifdef LIBXML_DEBUG_ENABLED
545 if ((debugent) && (!html))
546 xmlDebugDumpEntities(stdout, doc);
547#endif
548
549 /*
550 * free it.
551 */
552 xmlFreeDoc(doc);
553}
554
555int main(int argc, char **argv) {
556 int i, count;
557 int files = 0;
558
Daniel Veillardbe803962000-06-28 23:40:59 +0000559 LIBXML_TEST_VERSION
Daniel Veillardce8b83b2000-04-05 18:38:42 +0000560 for (i = 1; i < argc ; i++) {
561#ifdef LIBXML_DEBUG_ENABLED
562 if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
563 debug++;
564 else if ((!strcmp(argv[i], "-debugent")) || (!strcmp(argv[i], "--debugent")))
565 debugent++;
566 else if ((!strcmp(argv[i], "-shell")) ||
567 (!strcmp(argv[i], "--shell"))) {
568 shell++;
569 noout = 1;
570 } else
571#endif
572 if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
573 copy++;
574 else if ((!strcmp(argv[i], "-recover")) ||
575 (!strcmp(argv[i], "--recover")))
576 recovery++;
577 else if ((!strcmp(argv[i], "-noent")) ||
578 (!strcmp(argv[i], "--noent")))
579 noent++;
580 else if ((!strcmp(argv[i], "-noout")) ||
581 (!strcmp(argv[i], "--noout")))
582 noout++;
583 else if ((!strcmp(argv[i], "-htmlout")) ||
584 (!strcmp(argv[i], "--htmlout")))
585 htmlout++;
586#ifdef LIBXML_HTML_ENABLED
587 else if ((!strcmp(argv[i], "-html")) ||
588 (!strcmp(argv[i], "--html"))) {
589 html++;
590 }
591#endif /* LIBXML_HTML_ENABLED */
592 else if ((!strcmp(argv[i], "-nowrap")) ||
593 (!strcmp(argv[i], "--nowrap")))
594 nowrap++;
595 else if ((!strcmp(argv[i], "-valid")) ||
596 (!strcmp(argv[i], "--valid")))
597 valid++;
598 else if ((!strcmp(argv[i], "-postvalid")) ||
599 (!strcmp(argv[i], "--postvalid")))
600 postvalid++;
601 else if ((!strcmp(argv[i], "-insert")) ||
602 (!strcmp(argv[i], "--insert")))
603 insert++;
604 else if ((!strcmp(argv[i], "-repeat")) ||
605 (!strcmp(argv[i], "--repeat")))
606 repeat++;
607 else if ((!strcmp(argv[i], "-push")) ||
608 (!strcmp(argv[i], "--push")))
609 push++;
Daniel Veillard46e370e2000-07-21 20:32:03 +0000610#ifdef HAVE_SYS_MMAN_H
611 else if ((!strcmp(argv[i], "-memory")) ||
612 (!strcmp(argv[i], "--memory")))
613 memory++;
614#endif
Daniel Veillard5e873c42000-04-12 13:27:38 +0000615 else if ((!strcmp(argv[i], "-testIO")) ||
616 (!strcmp(argv[i], "--testIO")))
617 testIO++;
Daniel Veillardce8b83b2000-04-05 18:38:42 +0000618 else if ((!strcmp(argv[i], "-compress")) ||
619 (!strcmp(argv[i], "--compress"))) {
620 compress++;
621 xmlSetCompressMode(9);
622 }
623 else if ((!strcmp(argv[i], "-nowarning")) ||
624 (!strcmp(argv[i], "--nowarning"))) {
625 xmlGetWarningsDefaultValue = 0;
626 }
Daniel Veillardbe803962000-06-28 23:40:59 +0000627 else if ((!strcmp(argv[i], "-encode")) ||
628 (!strcmp(argv[i], "--encode"))) {
629 i++;
630 encoding = argv[i];
631 }
Daniel Veillardce8b83b2000-04-05 18:38:42 +0000632 else if ((!strcmp(argv[i], "-noblanks")) ||
633 (!strcmp(argv[i], "--noblanks"))) {
634 noblanks++;
635 xmlKeepBlanksDefault(0);
636 }
637 }
638 if (noent != 0) xmlSubstituteEntitiesDefault(1);
639 if (valid != 0) xmlDoValidityCheckingDefaultValue = 1;
640 if ((htmlout) && (!nowrap)) {
641 fprintf(stderr,
642 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\n");
643 fprintf(stderr, "\t\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n");
644 fprintf(stderr,
645 "<html><head><title>%s output</title></head>\n",
646 argv[0]);
647 fprintf(stderr,
648 "<body bgcolor=\"#ffffff\"><h1 align=\"center\">%s output</h1>\n",
649 argv[0]);
650 }
651 for (i = 1; i < argc ; i++) {
Daniel Veillardbe803962000-06-28 23:40:59 +0000652 if ((!strcmp(argv[i], "-encode")) ||
653 (!strcmp(argv[i], "--encode"))) {
654 i++;
655 continue;
656 }
Daniel Veillardce8b83b2000-04-05 18:38:42 +0000657 if (argv[i][0] != '-') {
658 if (repeat) {
659 for (count = 0;count < 100 * repeat;count++)
660 parseAndPrintFile(argv[i]);
661 } else
662 parseAndPrintFile(argv[i]);
663 files ++;
664 }
665 }
666 if ((htmlout) && (!nowrap)) {
667 fprintf(stderr, "</body></html>\n");
668 }
669 if (files == 0) {
670 printf("Usage : %s [--debug] [--debugent] [--copy] [--recover] [--noent] [--noout] [--valid] [--repeat] XMLfiles ...\n",
671 argv[0]);
672 printf("\tParse the XML files and output the result of the parsing\n");
673#ifdef LIBXML_DEBUG_ENABLED
674 printf("\t--debug : dump a debug tree of the in-memory document\n");
675 printf("\t--shell : run a navigating shell\n");
676 printf("\t--debugent : debug the entities defined in the document\n");
677#endif
678 printf("\t--copy : used to test the internal copy implementation\n");
679 printf("\t--recover : output what was parsable on broken XML documents\n");
680 printf("\t--noent : substitute entity references by their value\n");
681 printf("\t--noout : don't output the result tree\n");
682 printf("\t--htmlout : output results as HTML\n");
683 printf("\t--nowarp : do not put HTML doc wrapper\n");
684 printf("\t--valid : validate the document in addition to std well-formed check\n");
685 printf("\t--postvalid : do a posteriori validation, i.e after parsing\n");
686 printf("\t--repeat : repeat 100 times, for timing or profiling\n");
687 printf("\t--insert : ad-hoc test for valid insertions\n");
688 printf("\t--compress : turn on gzip compression of output\n");
689#ifdef LIBXML_HTML_ENABLED
690 printf("\t--html : use the HTML parser\n");
691#endif
692 printf("\t--push : use the push mode of the parser\n");
Daniel Veillard46e370e2000-07-21 20:32:03 +0000693#ifdef HAVE_SYS_MMAN_H
694 printf("\t--memory : parse from memory\n");
695#endif
Daniel Veillardce8b83b2000-04-05 18:38:42 +0000696 printf("\t--nowarning : do not emit warnings from parser/validator\n");
697 printf("\t--noblanks : drop (ignorable?) blanks spaces\n");
Daniel Veillard5e873c42000-04-12 13:27:38 +0000698 printf("\t--testIO : test user I/O support\n");
Daniel Veillard32bc74e2000-07-14 14:49:25 +0000699 printf("\t--encode encoding : output in the given encoding\n");
Daniel Veillardce8b83b2000-04-05 18:38:42 +0000700 }
701 xmlCleanupParser();
702 xmlMemoryDump();
703
704 return(0);
705}