2001-02-23 20:55:21 +03:00
/*
2003-08-21 02:54:39 +04:00
* SAX . c : Old SAX v1 handlers to build a tree .
* Deprecated except for compatibility
2001-02-23 20:55:21 +03:00
*
* See Copyright for the status of this software .
*
2001-06-24 16:13:24 +04:00
* Daniel Veillard < daniel @ veillard . com >
2001-02-23 20:55:21 +03:00
*/
2002-03-18 22:37:11 +03:00
# define IN_LIBXML
2001-04-21 20:57:29 +04:00
# include "libxml.h"
2001-02-23 20:55:21 +03:00
# include <stdlib.h>
# include <string.h>
# include <libxml/xmlmemory.h>
# include <libxml/tree.h>
# include <libxml/parser.h>
# include <libxml/parserInternals.h>
# include <libxml/valid.h>
# include <libxml/entities.h>
# include <libxml/xmlerror.h>
# include <libxml/debugXML.h>
# include <libxml/xmlIO.h>
# include <libxml/SAX.h>
# include <libxml/uri.h>
2001-08-07 05:10:10 +04:00
# include <libxml/valid.h>
2001-02-23 20:55:21 +03:00
# include <libxml/HTMLtree.h>
2003-08-21 02:54:39 +04:00
# include <libxml/SAX2.h>
2001-02-23 20:55:21 +03:00
Re-examined the problems of configuring a "minimal" library.
Synchronized the header files with the library code in order
to assure that all the various conditionals (LIBXML_xxxx_ENABLED)
were the same in both. Modified the API database content to more
accurately reflect the conditionals. Enhanced the generation
of that database. Although there was no substantial change to
any of the library code's logic, a large number of files were
modified to achieve the above, and the configuration script
was enhanced to do some automatic enabling of features (e.g.
--with-xinclude forces --with-xpath). Additionally, all the format
errors discovered by apibuild.py were corrected.
* configure.in: enhanced cross-checking of options
* doc/apibuild.py, doc/elfgcchack.xsl, doc/libxml2-refs.xml,
doc/libxml2-api.xml, gentest.py: changed the usage of the
<cond> element in module descriptions
* elfgcchack.h, testapi.c: regenerated with proper conditionals
* HTMLparser.c, SAX.c, globals.c, tree.c, xmlschemas.c, xpath.c,
testSAX.c: cleaned up conditionals
* include/libxml/[SAX.h, SAX2.h, debugXML.h, encoding.h, entities.h,
hash.h, parser.h, parserInternals.h, schemasInternals.h, tree.h,
valid.h, xlink.h, xmlIO.h, xmlautomata.h, xmlreader.h, xpath.h]:
synchronized the conditionals with the corresponding module code
* doc/examples/tree2.c, doc/examples/xpath1.c, doc/examples/xpath2.c:
added additional conditions required for compilation
* doc/*.html, doc/html/*.html: rebuilt the docs
2005-01-02 12:53:13 +03:00
# ifdef LIBXML_LEGACY_ENABLED
2003-09-30 04:43:48 +04:00
# ifdef LIBXML_SAX1_ENABLED
2001-02-23 20:55:21 +03:00
/**
2002-01-22 21:15:52 +03:00
* initxmlDefaultSAXHandler :
2001-12-31 19:16:02 +03:00
* @ hdlr : the SAX handler
* @ warning : flag if non - zero sets the handler warning procedure
2001-02-23 20:55:21 +03:00
*
2003-08-21 02:54:39 +04:00
* Initialize the default XML SAX version 1 handler
* DEPRECATED : use xmlSAX2InitDefaultSAXHandler ( ) for the new SAX2 blocks
2001-02-23 20:55:21 +03:00
*/
void
2003-09-25 18:29:29 +04:00
initxmlDefaultSAXHandler ( xmlSAXHandlerV1 * hdlr , int warning )
2001-02-23 20:55:21 +03:00
{
2012-09-11 09:26:36 +04:00
2001-10-13 13:15:48 +04:00
if ( hdlr - > initialized = = 1 )
2001-07-08 17:15:55 +04:00
return ;
2003-08-21 02:54:39 +04:00
hdlr - > internalSubset = xmlSAX2InternalSubset ;
hdlr - > externalSubset = xmlSAX2ExternalSubset ;
hdlr - > isStandalone = xmlSAX2IsStandalone ;
hdlr - > hasInternalSubset = xmlSAX2HasInternalSubset ;
hdlr - > hasExternalSubset = xmlSAX2HasExternalSubset ;
hdlr - > resolveEntity = xmlSAX2ResolveEntity ;
hdlr - > getEntity = xmlSAX2GetEntity ;
hdlr - > getParameterEntity = xmlSAX2GetParameterEntity ;
hdlr - > entityDecl = xmlSAX2EntityDecl ;
hdlr - > attributeDecl = xmlSAX2AttributeDecl ;
hdlr - > elementDecl = xmlSAX2ElementDecl ;
hdlr - > notationDecl = xmlSAX2NotationDecl ;
hdlr - > unparsedEntityDecl = xmlSAX2UnparsedEntityDecl ;
hdlr - > setDocumentLocator = xmlSAX2SetDocumentLocator ;
hdlr - > startDocument = xmlSAX2StartDocument ;
hdlr - > endDocument = xmlSAX2EndDocument ;
hdlr - > startElement = xmlSAX2StartElement ;
hdlr - > endElement = xmlSAX2EndElement ;
hdlr - > reference = xmlSAX2Reference ;
hdlr - > characters = xmlSAX2Characters ;
hdlr - > cdataBlock = xmlSAX2CDataBlock ;
hdlr - > ignorableWhitespace = xmlSAX2Characters ;
hdlr - > processingInstruction = xmlSAX2ProcessingInstruction ;
2001-10-13 13:15:48 +04:00
if ( warning = = 0 )
hdlr - > warning = NULL ;
2001-02-23 20:55:21 +03:00
else
2001-10-13 13:15:48 +04:00
hdlr - > warning = xmlParserWarning ;
hdlr - > error = xmlParserError ;
hdlr - > fatalError = xmlParserError ;
2001-07-08 17:15:55 +04:00
2001-10-13 13:15:48 +04:00
hdlr - > initialized = 1 ;
2001-02-23 20:55:21 +03:00
}
2001-10-13 13:15:48 +04:00
# ifdef LIBXML_HTML_ENABLED
2001-02-23 20:55:21 +03:00
/**
2002-01-22 21:15:52 +03:00
* inithtmlDefaultSAXHandler :
2001-12-31 19:16:02 +03:00
* @ hdlr : the SAX handler
2001-02-23 20:55:21 +03:00
*
2003-08-21 02:54:39 +04:00
* Initialize the default HTML SAX version 1 handler
* DEPRECATED : use xmlSAX2InitHtmlDefaultSAXHandler ( ) for the new SAX2 blocks
2001-02-23 20:55:21 +03:00
*/
void
2003-09-25 18:29:29 +04:00
inithtmlDefaultSAXHandler ( xmlSAXHandlerV1 * hdlr )
2001-02-23 20:55:21 +03:00
{
2001-10-13 13:15:48 +04:00
if ( hdlr - > initialized = = 1 )
2001-07-08 17:15:55 +04:00
return ;
2003-08-21 02:54:39 +04:00
hdlr - > internalSubset = xmlSAX2InternalSubset ;
2001-10-13 13:15:48 +04:00
hdlr - > externalSubset = NULL ;
hdlr - > isStandalone = NULL ;
hdlr - > hasInternalSubset = NULL ;
hdlr - > hasExternalSubset = NULL ;
hdlr - > resolveEntity = NULL ;
2003-08-21 02:54:39 +04:00
hdlr - > getEntity = xmlSAX2GetEntity ;
2001-10-13 13:15:48 +04:00
hdlr - > getParameterEntity = NULL ;
hdlr - > entityDecl = NULL ;
hdlr - > attributeDecl = NULL ;
hdlr - > elementDecl = NULL ;
hdlr - > notationDecl = NULL ;
hdlr - > unparsedEntityDecl = NULL ;
2003-08-21 02:54:39 +04:00
hdlr - > setDocumentLocator = xmlSAX2SetDocumentLocator ;
hdlr - > startDocument = xmlSAX2StartDocument ;
hdlr - > endDocument = xmlSAX2EndDocument ;
hdlr - > startElement = xmlSAX2StartElement ;
hdlr - > endElement = xmlSAX2EndElement ;
2001-10-13 13:15:48 +04:00
hdlr - > reference = NULL ;
2003-08-21 02:54:39 +04:00
hdlr - > characters = xmlSAX2Characters ;
hdlr - > cdataBlock = xmlSAX2CDataBlock ;
hdlr - > ignorableWhitespace = xmlSAX2IgnorableWhitespace ;
2004-10-22 18:34:23 +04:00
hdlr - > processingInstruction = xmlSAX2ProcessingInstruction ;
2003-08-21 02:54:39 +04:00
hdlr - > comment = xmlSAX2Comment ;
2001-10-13 13:15:48 +04:00
hdlr - > warning = xmlParserWarning ;
hdlr - > error = xmlParserError ;
hdlr - > fatalError = xmlParserError ;
hdlr - > initialized = 1 ;
2001-02-23 20:55:21 +03:00
}
2001-10-13 13:15:48 +04:00
2001-04-23 17:41:34 +04:00
# endif /* LIBXML_HTML_ENABLED */
2001-02-23 20:55:21 +03:00
Re-examined the problems of configuring a "minimal" library.
Synchronized the header files with the library code in order
to assure that all the various conditionals (LIBXML_xxxx_ENABLED)
were the same in both. Modified the API database content to more
accurately reflect the conditionals. Enhanced the generation
of that database. Although there was no substantial change to
any of the library code's logic, a large number of files were
modified to achieve the above, and the configuration script
was enhanced to do some automatic enabling of features (e.g.
--with-xinclude forces --with-xpath). Additionally, all the format
errors discovered by apibuild.py were corrected.
* configure.in: enhanced cross-checking of options
* doc/apibuild.py, doc/elfgcchack.xsl, doc/libxml2-refs.xml,
doc/libxml2-api.xml, gentest.py: changed the usage of the
<cond> element in module descriptions
* elfgcchack.h, testapi.c: regenerated with proper conditionals
* HTMLparser.c, SAX.c, globals.c, tree.c, xmlschemas.c, xpath.c,
testSAX.c: cleaned up conditionals
* include/libxml/[SAX.h, SAX2.h, debugXML.h, encoding.h, entities.h,
hash.h, parser.h, parserInternals.h, schemasInternals.h, tree.h,
valid.h, xlink.h, xmlIO.h, xmlautomata.h, xmlreader.h, xpath.h]:
synchronized the conditionals with the corresponding module code
* doc/examples/tree2.c, doc/examples/xpath1.c, doc/examples/xpath2.c:
added additional conditions required for compilation
* doc/*.html, doc/html/*.html: rebuilt the docs
2005-01-02 12:53:13 +03:00
# endif /* LIBXML_SAX1_ENABLED */
# endif /* LIBXML_LEGACY_ENABLED */