blob: d5157f6a14630c97b95447c139eb63668e9cadc4 [file] [log] [blame]
Daniel Veillardbe70ff71999-07-05 16:50:46 +00001/*
2 * testHTML.c : a small tester program for HTML input.
3 *
4 * See Copyright for the status of this software.
5 *
6 * Daniel.Veillard@w3.org
7 */
8
9#ifdef WIN32
Daniel Veillard3c558c31999-12-22 11:30:41 +000010#include "win32config.h"
Daniel Veillardbe70ff71999-07-05 16:50:46 +000011#else
Daniel Veillard7f7d1111999-09-22 09:46:25 +000012#include "config.h"
Daniel Veillardbe70ff71999-07-05 16:50:46 +000013#endif
Daniel Veillard7f7d1111999-09-22 09:46:25 +000014
Daniel Veillard361d8452000-04-03 19:48:13 +000015#include "xmlversion.h"
16#ifdef LIBXML_HTML_ENABLED
17
Daniel Veillard7f7d1111999-09-22 09:46:25 +000018#include <stdio.h>
19#include <string.h>
Daniel Veillard7c1206f1999-10-14 09:10:25 +000020#include <stdarg.h>
21
Daniel Veillard7f7d1111999-09-22 09:46:25 +000022
23#ifdef HAVE_SYS_TYPES_H
Daniel Veillardbe70ff71999-07-05 16:50:46 +000024#include <sys/types.h>
Daniel Veillard7f7d1111999-09-22 09:46:25 +000025#endif
Daniel Veillardbe70ff71999-07-05 16:50:46 +000026#ifdef HAVE_SYS_STAT_H
27#include <sys/stat.h>
28#endif
29#ifdef HAVE_FCNTL_H
30#include <fcntl.h>
31#endif
32#ifdef HAVE_UNISTD_H
33#include <unistd.h>
34#endif
Daniel Veillard7f7d1111999-09-22 09:46:25 +000035#ifdef HAVE_STDLIB_H
Daniel Veillardbe70ff71999-07-05 16:50:46 +000036#include <stdlib.h>
Daniel Veillard7f7d1111999-09-22 09:46:25 +000037#endif
Daniel Veillardbe70ff71999-07-05 16:50:46 +000038
Daniel Veillard361d8452000-04-03 19:48:13 +000039#include <libxml/xmlmemory.h>
40#include <libxml/HTMLparser.h>
41#include <libxml/HTMLtree.h>
42#include <libxml/debugXML.h>
Daniel Veillardbe70ff71999-07-05 16:50:46 +000043
Daniel Veillard361d8452000-04-03 19:48:13 +000044#ifdef LIBXML_DEBUG_ENABLED
Daniel Veillardbe70ff71999-07-05 16:50:46 +000045static int debug = 0;
Daniel Veillard361d8452000-04-03 19:48:13 +000046#endif
Daniel Veillardbe70ff71999-07-05 16:50:46 +000047static int copy = 0;
Daniel Veillard7c1206f1999-10-14 09:10:25 +000048static int sax = 0;
49static int repeat = 0;
50static int noout = 0;
Daniel Veillard5e5c6231999-12-29 12:49:06 +000051static int push = 0;
Daniel Veillardbe70ff71999-07-05 16:50:46 +000052
Daniel Veillard7c1206f1999-10-14 09:10:25 +000053xmlSAXHandler emptySAXHandlerStruct = {
54 NULL, /* internalSubset */
55 NULL, /* isStandalone */
56 NULL, /* hasInternalSubset */
57 NULL, /* hasExternalSubset */
58 NULL, /* resolveEntity */
59 NULL, /* getEntity */
60 NULL, /* entityDecl */
61 NULL, /* notationDecl */
62 NULL, /* attributeDecl */
63 NULL, /* elementDecl */
64 NULL, /* unparsedEntityDecl */
65 NULL, /* setDocumentLocator */
66 NULL, /* startDocument */
67 NULL, /* endDocument */
68 NULL, /* startElement */
69 NULL, /* endElement */
70 NULL, /* reference */
71 NULL, /* characters */
72 NULL, /* ignorableWhitespace */
73 NULL, /* processingInstruction */
74 NULL, /* comment */
75 NULL, /* xmlParserWarning */
76 NULL, /* xmlParserError */
77 NULL, /* xmlParserError */
78 NULL, /* getParameterEntity */
79};
80
81xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct;
82extern xmlSAXHandlerPtr debugSAXHandler;
83
84/************************************************************************
85 * *
86 * Debug Handlers *
87 * *
88 ************************************************************************/
89
90/**
91 * isStandaloneDebug:
92 * @ctxt: An XML parser context
93 *
94 * Is this document tagged standalone ?
95 *
96 * Returns 1 if true
97 */
98int
99isStandaloneDebug(void *ctx)
100{
101 fprintf(stdout, "SAX.isStandalone()\n");
102 return(0);
103}
104
105/**
106 * hasInternalSubsetDebug:
107 * @ctxt: An XML parser context
108 *
109 * Does this document has an internal subset
110 *
111 * Returns 1 if true
112 */
113int
114hasInternalSubsetDebug(void *ctx)
115{
116 fprintf(stdout, "SAX.hasInternalSubset()\n");
117 return(0);
118}
119
120/**
121 * hasExternalSubsetDebug:
122 * @ctxt: An XML parser context
123 *
124 * Does this document has an external subset
125 *
126 * Returns 1 if true
127 */
128int
129hasExternalSubsetDebug(void *ctx)
130{
131 fprintf(stdout, "SAX.hasExternalSubset()\n");
132 return(0);
133}
134
135/**
136 * hasInternalSubsetDebug:
137 * @ctxt: An XML parser context
138 *
139 * Does this document has an internal subset
140 */
141void
142internalSubsetDebug(void *ctx, const xmlChar *name,
143 const xmlChar *ExternalID, const xmlChar *SystemID)
144{
145 /* xmlDtdPtr externalSubset; */
146
147 fprintf(stdout, "SAX.internalSubset(%s, %s, %s)\n",
148 name, ExternalID, SystemID);
149
150/***********
151 if ((ExternalID != NULL) || (SystemID != NULL)) {
152 externalSubset = xmlParseDTD(ExternalID, SystemID);
153 if (externalSubset != NULL) {
154 xmlFreeDtd(externalSubset);
155 }
156 }
157 ***********/
158}
159
160/**
161 * resolveEntityDebug:
162 * @ctxt: An XML parser context
163 * @publicId: The public ID of the entity
164 * @systemId: The system ID of the entity
165 *
166 * Special entity resolver, better left to the parser, it has
167 * more context than the application layer.
168 * The default behaviour is to NOT resolve the entities, in that case
169 * the ENTITY_REF nodes are built in the structure (and the parameter
170 * values).
171 *
172 * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
173 */
174xmlParserInputPtr
175resolveEntityDebug(void *ctx, const xmlChar *publicId, const xmlChar *systemId)
176{
177 /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
178
179
180 fprintf(stdout, "SAX.resolveEntity(");
181 if (publicId != NULL)
182 fprintf(stdout, "%s", (char *)publicId);
183 else
184 fprintf(stdout, " ");
185 if (systemId != NULL)
186 fprintf(stdout, ", %s)\n", (char *)systemId);
187 else
188 fprintf(stdout, ", )\n");
189/*********
190 if (systemId != NULL) {
191 return(xmlNewInputFromFile(ctxt, (char *) systemId));
192 }
193 *********/
194 return(NULL);
195}
196
197/**
198 * getEntityDebug:
199 * @ctxt: An XML parser context
200 * @name: The entity name
201 *
202 * Get an entity by name
203 *
204 * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
205 */
206xmlEntityPtr
207getEntityDebug(void *ctx, const xmlChar *name)
208{
209 fprintf(stdout, "SAX.getEntity(%s)\n", name);
210 return(NULL);
211}
212
213/**
214 * getParameterEntityDebug:
215 * @ctxt: An XML parser context
216 * @name: The entity name
217 *
218 * Get a parameter entity by name
219 *
220 * Returns the xmlParserInputPtr
221 */
222xmlEntityPtr
223getParameterEntityDebug(void *ctx, const xmlChar *name)
224{
225 fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
226 return(NULL);
227}
228
229
230/**
231 * entityDeclDebug:
232 * @ctxt: An XML parser context
233 * @name: the entity name
234 * @type: the entity type
235 * @publicId: The public ID of the entity
236 * @systemId: The system ID of the entity
237 * @content: the entity value (without processing).
238 *
239 * An entity definition has been parsed
240 */
241void
242entityDeclDebug(void *ctx, const xmlChar *name, int type,
243 const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
244{
245 fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
246 name, type, publicId, systemId, content);
247}
248
249/**
250 * attributeDeclDebug:
251 * @ctxt: An XML parser context
252 * @name: the attribute name
253 * @type: the attribute type
254 *
255 * An attribute definition has been parsed
256 */
257void
258attributeDeclDebug(void *ctx, const xmlChar *elem, const xmlChar *name,
259 int type, int def, const xmlChar *defaultValue,
260 xmlEnumerationPtr tree)
261{
262 fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",
263 elem, name, type, def, defaultValue);
264}
265
266/**
267 * elementDeclDebug:
268 * @ctxt: An XML parser context
269 * @name: the element name
270 * @type: the element type
271 * @content: the element value (without processing).
272 *
273 * An element definition has been parsed
274 */
275void
276elementDeclDebug(void *ctx, const xmlChar *name, int type,
277 xmlElementContentPtr content)
278{
279 fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
280 name, type);
281}
282
283/**
284 * notationDeclDebug:
285 * @ctxt: An XML parser context
286 * @name: The name of the notation
287 * @publicId: The public ID of the entity
288 * @systemId: The system ID of the entity
289 *
290 * What to do when a notation declaration has been parsed.
291 */
292void
293notationDeclDebug(void *ctx, const xmlChar *name,
294 const xmlChar *publicId, const xmlChar *systemId)
295{
296 fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
297 (char *) name, (char *) publicId, (char *) systemId);
298}
299
300/**
301 * unparsedEntityDeclDebug:
302 * @ctxt: An XML parser context
303 * @name: The name of the entity
304 * @publicId: The public ID of the entity
305 * @systemId: The system ID of the entity
306 * @notationName: the name of the notation
307 *
308 * What to do when an unparsed entity declaration is parsed
309 */
310void
311unparsedEntityDeclDebug(void *ctx, const xmlChar *name,
312 const xmlChar *publicId, const xmlChar *systemId,
313 const xmlChar *notationName)
314{
315 fprintf(stdout, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n",
316 (char *) name, (char *) publicId, (char *) systemId,
317 (char *) notationName);
318}
319
320/**
321 * setDocumentLocatorDebug:
322 * @ctxt: An XML parser context
323 * @loc: A SAX Locator
324 *
325 * Receive the document locator at startup, actually xmlDefaultSAXLocator
326 * Everything is available on the context, so this is useless in our case.
327 */
328void
329setDocumentLocatorDebug(void *ctx, xmlSAXLocatorPtr loc)
330{
331 fprintf(stdout, "SAX.setDocumentLocator()\n");
332}
333
334/**
335 * startDocumentDebug:
336 * @ctxt: An XML parser context
337 *
338 * called when the document start being processed.
339 */
340void
341startDocumentDebug(void *ctx)
342{
343 fprintf(stdout, "SAX.startDocument()\n");
344}
345
346/**
347 * endDocumentDebug:
348 * @ctxt: An XML parser context
349 *
350 * called when the document end has been detected.
351 */
352void
353endDocumentDebug(void *ctx)
354{
355 fprintf(stdout, "SAX.endDocument()\n");
356}
357
358/**
359 * startElementDebug:
360 * @ctxt: An XML parser context
361 * @name: The element name
362 *
363 * called when an opening tag has been processed.
364 */
365void
366startElementDebug(void *ctx, const xmlChar *name, const xmlChar **atts)
367{
368 int i;
369
370 fprintf(stdout, "SAX.startElement(%s", (char *) name);
371 if (atts != NULL) {
372 for (i = 0;(atts[i] != NULL);i++) {
373 fprintf(stdout, ", %s='", atts[i++]);
374 fprintf(stdout, "%s'", atts[i]);
375 }
376 }
377 fprintf(stdout, ")\n");
378}
379
380/**
381 * endElementDebug:
382 * @ctxt: An XML parser context
383 * @name: The element name
384 *
385 * called when the end of an element has been detected.
386 */
387void
388endElementDebug(void *ctx, const xmlChar *name)
389{
390 fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
391}
392
393/**
394 * charactersDebug:
395 * @ctxt: An XML parser context
396 * @ch: a xmlChar string
397 * @len: the number of xmlChar
398 *
399 * receiving some chars from the parser.
400 * Question: how much at a time ???
401 */
402void
403charactersDebug(void *ctx, const xmlChar *ch, int len)
404{
405 int i;
406
407 fprintf(stdout, "SAX.characters(");
408 for (i = 0;(i < len) && (i < 30);i++)
409 fprintf(stdout, "%c", ch[i]);
410 fprintf(stdout, ", %d)\n", len);
411}
412
413/**
414 * referenceDebug:
415 * @ctxt: An XML parser context
416 * @name: The entity name
417 *
418 * called when an entity reference is detected.
419 */
420void
421referenceDebug(void *ctx, const xmlChar *name)
422{
423 fprintf(stdout, "SAX.reference(%s)\n", name);
424}
425
426/**
427 * ignorableWhitespaceDebug:
428 * @ctxt: An XML parser context
429 * @ch: a xmlChar string
430 * @start: the first char in the string
431 * @len: the number of xmlChar
432 *
433 * receiving some ignorable whitespaces from the parser.
434 * Question: how much at a time ???
435 */
436void
437ignorableWhitespaceDebug(void *ctx, const xmlChar *ch, int len)
438{
439 fprintf(stdout, "SAX.ignorableWhitespace(%.30s, %d)\n",
440 (char *) ch, len);
441}
442
443/**
444 * processingInstructionDebug:
445 * @ctxt: An XML parser context
446 * @target: the target name
447 * @data: the PI data's
448 * @len: the number of xmlChar
449 *
450 * A processing instruction has been parsed.
451 */
452void
453processingInstructionDebug(void *ctx, const xmlChar *target,
454 const xmlChar *data)
455{
456 fprintf(stdout, "SAX.processingInstruction(%s, %s)\n",
457 (char *) target, (char *) data);
458}
459
460/**
461 * commentDebug:
462 * @ctxt: An XML parser context
463 * @value: the comment content
464 *
465 * A comment has been parsed.
466 */
467void
468commentDebug(void *ctx, const xmlChar *value)
469{
470 fprintf(stdout, "SAX.comment(%s)\n", value);
471}
472
473/**
474 * warningDebug:
475 * @ctxt: An XML parser context
476 * @msg: the message to display/transmit
477 * @...: extra parameters for the message display
478 *
479 * Display and format a warning messages, gives file, line, position and
480 * extra parameters.
481 */
482void
483warningDebug(void *ctx, const char *msg, ...)
484{
485 va_list args;
486
487 va_start(args, msg);
488 fprintf(stdout, "SAX.warning: ");
489 vfprintf(stdout, msg, args);
490 va_end(args);
491}
492
493/**
494 * errorDebug:
495 * @ctxt: An XML parser context
496 * @msg: the message to display/transmit
497 * @...: extra parameters for the message display
498 *
499 * Display and format a error messages, gives file, line, position and
500 * extra parameters.
501 */
502void
503errorDebug(void *ctx, const char *msg, ...)
504{
505 va_list args;
506
507 va_start(args, msg);
508 fprintf(stdout, "SAX.error: ");
509 vfprintf(stdout, msg, args);
510 va_end(args);
511}
512
513/**
514 * fatalErrorDebug:
515 * @ctxt: An XML parser context
516 * @msg: the message to display/transmit
517 * @...: extra parameters for the message display
518 *
519 * Display and format a fatalError messages, gives file, line, position and
520 * extra parameters.
521 */
522void
523fatalErrorDebug(void *ctx, const char *msg, ...)
524{
525 va_list args;
526
527 va_start(args, msg);
528 fprintf(stdout, "SAX.fatalError: ");
529 vfprintf(stdout, msg, args);
530 va_end(args);
531}
532
533xmlSAXHandler debugSAXHandlerStruct = {
534 internalSubsetDebug,
535 isStandaloneDebug,
536 hasInternalSubsetDebug,
537 hasExternalSubsetDebug,
538 resolveEntityDebug,
539 getEntityDebug,
540 entityDeclDebug,
541 notationDeclDebug,
542 attributeDeclDebug,
543 elementDeclDebug,
544 unparsedEntityDeclDebug,
545 setDocumentLocatorDebug,
546 startDocumentDebug,
547 endDocumentDebug,
548 startElementDebug,
549 endElementDebug,
550 referenceDebug,
551 charactersDebug,
552 ignorableWhitespaceDebug,
553 processingInstructionDebug,
554 commentDebug,
555 warningDebug,
556 errorDebug,
557 fatalErrorDebug,
558 getParameterEntityDebug,
559};
560
561xmlSAXHandlerPtr debugSAXHandler = &debugSAXHandlerStruct;
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000562/************************************************************************
563 * *
564 * Debug *
565 * *
566 ************************************************************************/
567
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000568void parseSAXFile(char *filename) {
569 htmlDocPtr doc;
570 /*
571 * Empty callbacks for checking
572 */
573 doc = htmlSAXParseFile(filename, NULL, emptySAXHandler, NULL);
574 if (doc != NULL) {
575 fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
576 xmlFreeDoc(doc);
577 }
578
579 if (!noout) {
580 /*
581 * Debug callback
582 */
583 doc = htmlSAXParseFile(filename, NULL, debugSAXHandler, NULL);
584 if (doc != NULL) {
585 fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
586 xmlFreeDoc(doc);
587 }
588 }
589}
590
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000591void parseAndPrintFile(char *filename) {
Daniel Veillard2eac5032000-01-09 21:08:56 +0000592 htmlDocPtr doc = NULL, tmp;
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000593
594 /*
595 * build an HTML tree from a string;
596 */
Daniel Veillard5e5c6231999-12-29 12:49:06 +0000597 if (push) {
598 FILE *f;
599
600 f = fopen(filename, "r");
601 if (f != NULL) {
602 int res, size = 3;
603 char chars[1024];
604 htmlParserCtxtPtr ctxt;
605
606 if (repeat)
607 size = 1024;
608 res = fread(chars, 1, 4, f);
609 if (res > 0) {
610 ctxt = htmlCreatePushParserCtxt(NULL, NULL,
611 chars, res, filename, 0);
612 while ((res = fread(chars, 1, size, f)) > 0) {
613 htmlParseChunk(ctxt, chars, res, 0);
614 }
615 htmlParseChunk(ctxt, chars, 0, 1);
616 doc = ctxt->myDoc;
617 htmlFreeParserCtxt(ctxt);
618 }
619 }
620 } else {
621 doc = htmlParseFile(filename, NULL);
622 }
623 if (doc == NULL) {
624 fprintf(stderr, "Could not parse %s\n", filename);
625 }
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000626
627 /*
628 * test intermediate copy if needed.
629 */
630 if (copy) {
631 tmp = doc;
632 doc = xmlCopyDoc(doc, 1);
633 xmlFreeDoc(tmp);
634 }
635
636 /*
637 * print it.
638 */
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000639 if (!noout) {
Daniel Veillard361d8452000-04-03 19:48:13 +0000640#ifdef LIBXML_DEBUG_ENABLED
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000641 if (!debug)
642 htmlDocDump(stdout, doc);
643 else
644 xmlDebugDumpDocument(stdout, doc);
Daniel Veillard361d8452000-04-03 19:48:13 +0000645#else
646 htmlDocDump(stdout, doc);
647#endif
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000648 }
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000649
650 /*
651 * free it.
652 */
653 xmlFreeDoc(doc);
654}
655
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000656int main(int argc, char **argv) {
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000657 int i, count;
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000658 int files = 0;
659
660 for (i = 1; i < argc ; i++) {
Daniel Veillard361d8452000-04-03 19:48:13 +0000661#ifdef LIBXML_DEBUG_ENABLED
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000662 if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
663 debug++;
Daniel Veillard361d8452000-04-03 19:48:13 +0000664 else
665#endif
666 if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000667 copy++;
Daniel Veillard5e5c6231999-12-29 12:49:06 +0000668 else if ((!strcmp(argv[i], "-push")) || (!strcmp(argv[i], "--push")))
669 push++;
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000670 else if ((!strcmp(argv[i], "-sax")) || (!strcmp(argv[i], "--sax")))
671 sax++;
672 else if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout")))
673 noout++;
674 else if ((!strcmp(argv[i], "-repeat")) ||
675 (!strcmp(argv[i], "--repeat")))
676 repeat++;
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000677 }
678 for (i = 1; i < argc ; i++) {
679 if (argv[i][0] != '-') {
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000680 if (repeat) {
681 for (count = 0;count < 100 * repeat;count++) {
682 if (sax)
683 parseSAXFile(argv[i]);
684 else
685 parseAndPrintFile(argv[i]);
686 }
687 } else {
688 if (sax)
689 parseSAXFile(argv[i]);
690 else
691 parseAndPrintFile(argv[i]);
692 }
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000693 files ++;
694 }
695 }
696 if (files == 0) {
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000697 printf("Usage : %s [--debug] [--copy] [--copy] HTMLfiles ...\n",
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000698 argv[0]);
699 printf("\tParse the HTML files and output the result of the parsing\n");
Daniel Veillard361d8452000-04-03 19:48:13 +0000700#ifdef LIBXML_DEBUG_ENABLED
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000701 printf("\t--debug : dump a debug tree of the in-memory document\n");
Daniel Veillard361d8452000-04-03 19:48:13 +0000702#endif
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000703 printf("\t--copy : used to test the internal copy implementation\n");
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000704 printf("\t--sax : debug the sequence of SAX callbacks\n");
Daniel Veillard5e5c6231999-12-29 12:49:06 +0000705 printf("\t--repeat : parse the file 100 times, for timing\n");
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000706 printf("\t--noout : do not print the result\n");
Daniel Veillard5e5c6231999-12-29 12:49:06 +0000707 printf("\t--push : use the push mode parser\n");
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000708 }
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000709 xmlCleanupParser();
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000710 xmlMemoryDump();
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000711
712 return(0);
713}
Daniel Veillard361d8452000-04-03 19:48:13 +0000714#else /* !LIBXML_HTML_ENABLED */
715#include <stdio.h>
716int main(int argc, char **argv) {
717 printf("%s : HTML support not compiled in\n", argv[0]);
718 return(0);
719}
720#endif