|
1 /* |
|
2 * libxml2_sax.c : Old SAX v1 handlers to build a tree. |
|
3 * Deprecated except for compatibility |
|
4 * |
|
5 * See Copyright for the status of this software. |
|
6 * |
|
7 * Daniel Veillard <daniel@veillard.com> |
|
8 */ |
|
9 |
|
10 #define IN_LIBXML |
|
11 |
|
12 #include "xmlenglibxml.h" |
|
13 |
|
14 #include <stdlib.h> |
|
15 #include <string.h> |
|
16 |
|
17 #include <stdapis/libxml2/libxml2_parserinternals.h> |
|
18 #include <stdapis/libxml2/libxml2_uri.h> |
|
19 #include <stdapis/libxml2/libxml2_globals.h> |
|
20 |
|
21 #ifdef LIBXML_HTML_ENABLED |
|
22 #include "libxml2_htmltree.h" |
|
23 #endif |
|
24 |
|
25 #ifdef LIBXML_DEBUG_ENABLED |
|
26 #include "libxml2_debugxml.h" |
|
27 #endif |
|
28 |
|
29 #ifdef LIBXML_SAX1_ENABLED |
|
30 /** |
|
31 * initxmlDefaultSAXHandler: |
|
32 * @param hdlr the SAX handler |
|
33 * @param warning flag if non-zero sets the handler warning procedure |
|
34 * |
|
35 * Initialize the default XML SAX version 1 handler |
|
36 * DEPRECATED: use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks |
|
37 */ |
|
38 XMLPUBFUNEXPORT void |
|
39 initxmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr, int warning) |
|
40 { |
|
41 if(hdlr->initialized == 1) |
|
42 return; |
|
43 |
|
44 hdlr->internalSubset = xmlSAX2InternalSubset; |
|
45 hdlr->externalSubset = xmlSAX2ExternalSubset; |
|
46 hdlr->isStandalone = xmlSAX2IsStandalone; |
|
47 hdlr->hasInternalSubset = xmlSAX2HasInternalSubset; |
|
48 hdlr->hasExternalSubset = xmlSAX2HasExternalSubset; |
|
49 hdlr->resolveEntity = xmlSAX2ResolveEntity; |
|
50 hdlr->getEntity = xmlSAX2GetEntity; |
|
51 hdlr->getParameterEntity = xmlSAX2GetParameterEntity; |
|
52 hdlr->entityDecl = xmlSAX2EntityDecl; |
|
53 hdlr->attributeDecl = xmlSAX2AttributeDecl; |
|
54 hdlr->elementDecl = xmlSAX2ElementDecl; |
|
55 hdlr->notationDecl = xmlSAX2NotationDecl; |
|
56 hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl; |
|
57 hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator; |
|
58 hdlr->startDocument = xmlSAX2StartDocument; |
|
59 hdlr->endDocument = xmlSAX2EndDocument; |
|
60 hdlr->startElement = xmlSAX2StartElement; |
|
61 hdlr->endElement = xmlSAX2EndElement; |
|
62 hdlr->reference = xmlSAX2Reference; |
|
63 hdlr->characters = xmlSAX2Characters; |
|
64 hdlr->cdataBlock = xmlSAX2CDataBlock; |
|
65 hdlr->ignorableWhitespace = xmlSAX2Characters; |
|
66 hdlr->processingInstruction = xmlSAX2ProcessingInstruction; |
|
67 if (warning == 0) |
|
68 hdlr->warning = NULL; |
|
69 else |
|
70 hdlr->warning = xmlParserWarning; |
|
71 hdlr->error = xmlParserError; |
|
72 hdlr->fatalError = xmlParserError; |
|
73 |
|
74 hdlr->initialized = 1; |
|
75 } |
|
76 #endif /* LIBXML_SAX1_ENABLED */ |