testHTML.c revision 38ae7e4efe803ea78b6499cd05a394db32623e41
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * testHTML.c : a small tester program for HTML input.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * See Copyright for the status of this software.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * daniel@veillard.com
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic int debug = 0;
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic int copy = 0;
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic int sax = 0;
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic int repeat = 0;
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic int noout = 0;
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic int push = 0;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#endif /* LIBXML_PUSH_ENABLED */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic int options = 0;
91d632c867159b669d90fc7e172295433d0519efgwrstatic xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct;
91d632c867159b669d90fc7e172295433d0519efgwr/************************************************************************
91d632c867159b669d90fc7e172295433d0519efgwr * Debug Handlers *
91d632c867159b669d90fc7e172295433d0519efgwr ************************************************************************/
91d632c867159b669d90fc7e172295433d0519efgwr * isStandaloneDebug:
91d632c867159b669d90fc7e172295433d0519efgwr * @ctxt: An XML parser context
91d632c867159b669d90fc7e172295433d0519efgwr * Is this document tagged standalone ?
91d632c867159b669d90fc7e172295433d0519efgwr * Returns 1 if true
91d632c867159b669d90fc7e172295433d0519efgwr return(0);
91d632c867159b669d90fc7e172295433d0519efgwr * hasInternalSubsetDebug:
91d632c867159b669d90fc7e172295433d0519efgwr * @ctxt: An XML parser context
91d632c867159b669d90fc7e172295433d0519efgwr * Does this document has an internal subset
91d632c867159b669d90fc7e172295433d0519efgwr * Returns 1 if true
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * hasExternalSubsetDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Does this document has an external subset
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Returns 1 if true
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * hasInternalSubsetDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Does this document has an internal subset
4bff34e37def8a90f9194d81bc345c52ba20086athurlowinternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * resolveEntityDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @publicId: The public ID of the entity
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @systemId: The system ID of the entity
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Special entity resolver, better left to the parser, it has
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * more context than the application layer.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * The default behaviour is to NOT resolve the entities, in that case
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * the ENTITY_REF nodes are built in the structure (and the parameter
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowresolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if (systemId != NULL) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow return(xmlNewInputFromFile(ctxt, (char *) systemId));
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * getEntityDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @name: The entity name
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Get an entity by name
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowgetEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * getParameterEntityDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @name: The entity name
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Get a parameter entity by name
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Returns the xmlParserInputPtr
4bff34e37def8a90f9194d81bc345c52ba20086athurlowgetParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * entityDeclDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @name: the entity name
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @type: the entity type
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @publicId: The public ID of the entity
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @systemId: The system ID of the entity
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @content: the entity value (without processing).
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * An entity definition has been parsed
4bff34e37def8a90f9194d81bc345c52ba20086athurlowentityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * attributeDeclDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @name: the attribute name
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @type: the attribute type
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * An attribute definition has been parsed
4bff34e37def8a90f9194d81bc345c52ba20086athurlowattributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *elem, const xmlChar *name,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * elementDeclDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @name: the element name
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @type: the element type
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @content: the element value (without processing).
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * An element definition has been parsed
4bff34e37def8a90f9194d81bc345c52ba20086athurlowelementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * notationDeclDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @name: The name of the notation
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @publicId: The public ID of the entity
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @systemId: The system ID of the entity
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * What to do when a notation declaration has been parsed.
4bff34e37def8a90f9194d81bc345c52ba20086athurlownotationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow (char *) name, (char *) publicId, (char *) systemId);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * unparsedEntityDeclDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @name: The name of the entity
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @publicId: The public ID of the entity
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @systemId: The system ID of the entity
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @notationName: the name of the notation
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * What to do when an unparsed entity declaration is parsed
4bff34e37def8a90f9194d81bc345c52ba20086athurlowunparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n",
4bff34e37def8a90f9194d81bc345c52ba20086athurlow (char *) name, (char *) publicId, (char *) systemId,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * setDocumentLocatorDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @loc: A SAX Locator
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Receive the document locator at startup, actually xmlDefaultSAXLocator
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Everything is available on the context, so this is useless in our case.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowsetDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * startDocumentDebug:
91d632c867159b669d90fc7e172295433d0519efgwr * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * called when the document start being processed.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * endDocumentDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * called when the document end has been detected.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * startElementDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @name: The element name
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * called when an opening tag has been processed.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstartElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "SAX.startElement(%s", (char *) name);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow htmlEncodeEntities(output, &outlen, att, &attlen, '\'');
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * endElementDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @name: The element name
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * called when the end of an element has been detected.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowendElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * charactersDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ch: a xmlChar string
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @len: the number of xmlChar
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * receiving some chars from the parser.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Question: how much at a time ???
4bff34e37def8a90f9194d81bc345c52ba20086athurlowcharactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "SAX.characters(%s, %d)\n", output, len);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * cdataDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ch: a xmlChar string
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @len: the number of xmlChar
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * receiving some cdata chars from the parser.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Question: how much at a time ???
4bff34e37def8a90f9194d81bc345c52ba20086athurlowcdataDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "SAX.cdata(%s, %d)\n", output, len);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * referenceDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @name: The entity name
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * called when an entity reference is detected.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowreferenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
91d632c867159b669d90fc7e172295433d0519efgwr * ignorableWhitespaceDebug:
91d632c867159b669d90fc7e172295433d0519efgwr * @ctxt: An XML parser context
91d632c867159b669d90fc7e172295433d0519efgwr * @ch: a xmlChar string
91d632c867159b669d90fc7e172295433d0519efgwr * @start: the first char in the string
91d632c867159b669d90fc7e172295433d0519efgwr * @len: the number of xmlChar
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * receiving some ignorable whitespaces from the parser.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Question: how much at a time ???
4bff34e37def8a90f9194d81bc345c52ba20086athurlowignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "SAX.ignorableWhitespace(%s, %d)\n", output, len);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * processingInstructionDebug:
91d632c867159b669d90fc7e172295433d0519efgwr * @ctxt: An XML parser context
91d632c867159b669d90fc7e172295433d0519efgwr * @target: the target name
91d632c867159b669d90fc7e172295433d0519efgwr * @data: the PI data's
91d632c867159b669d90fc7e172295433d0519efgwr * @len: the number of xmlChar
91d632c867159b669d90fc7e172295433d0519efgwr * A processing instruction has been parsed.
91d632c867159b669d90fc7e172295433d0519efgwrstatic void
4bff34e37def8a90f9194d81bc345c52ba20086athurlowprocessingInstructionDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *target,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "SAX.processingInstruction(%s, %s)\n",
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * commentDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @value: the comment content
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * A comment has been parsed.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowcommentDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * warningDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @msg: the message to display/transmit
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @...: extra parameters for the message display
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Display and format a warning messages, gives file, line, position and
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * extra parameters.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowwarningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * errorDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @msg: the message to display/transmit
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @...: extra parameters for the message display
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Display and format a error messages, gives file, line, position and
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * extra parameters.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowerrorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * fatalErrorDebug:
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @ctxt: An XML parser context
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @msg: the message to display/transmit
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * @...: extra parameters for the message display
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Display and format a fatalError messages, gives file, line, position and
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * extra parameters.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowfatalErrorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
4bff34e37def8a90f9194d81bc345c52ba20086athurlowxmlSAXHandlerPtr debugSAXHandler = &debugSAXHandlerStruct;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/************************************************************************
4bff34e37def8a90f9194d81bc345c52ba20086athurlow ************************************************************************/
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Empty callbacks for checking
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if (f != NULL) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /* if (repeat) */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow ctxt = htmlCreatePushParserCtxt(emptySAXHandler, NULL,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if (f != NULL) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /* if (repeat) */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow ctxt = htmlCreatePushParserCtxt(debugSAXHandler, NULL,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#endif /* LIBXML_PUSH_ENABLED */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow doc = htmlSAXParseFile(filename, NULL, emptySAXHandler, NULL);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Debug callback
4bff34e37def8a90f9194d81bc345c52ba20086athurlow doc = htmlSAXParseFile(filename, NULL, debugSAXHandler, NULL);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#endif /* LIBXML_PUSH_ENABLED */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * build an HTML tree from a string;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if (f != NULL) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow /* if (repeat) */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * test intermediate copy if needed.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * print it.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#endif /* LIBXML_OUTPUT_ENABLED */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
4bff34e37def8a90f9194d81bc345c52ba20086athurlow else if ((!strcmp(argv[i], "-push")) || (!strcmp(argv[i], "--push")))
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#endif /* LIBXML_PUSH_ENABLED */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow else if ((!strcmp(argv[i], "-sax")) || (!strcmp(argv[i], "--sax")))
4bff34e37def8a90f9194d81bc345c52ba20086athurlow else if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout")))
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if (files == 0) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow printf("Usage : %s [--debug] [--copy] [--copy] HTMLfiles ...\n",
4bff34e37def8a90f9194d81bc345c52ba20086athurlow printf("\tParse the HTML files and output the result of the parsing\n");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow printf("\t--debug : dump a debug tree of the in-memory document\n");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow printf("\t--copy : used to test the internal copy implementation\n");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow printf("\t--sax : debug the sequence of SAX callbacks\n");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow printf("\t--repeat : parse the file 100 times, for timing\n");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#endif /* LIBXML_PUSH_ENABLED */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow printf("\t--encode encoding : output in the given encoding\n");
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#else /* !LIBXML_HTML_ENABLED */
4bff34e37def8a90f9194d81bc345c52ba20086athurlowint main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow printf("%s : HTML support not compiled in\n", argv[0]);