1 /* 2 * Summary: SAX2 parser interface used to build the DOM tree 3 * Description: those are the default SAX2 interfaces used by 4 * the library when building DOM tree. 5 * 6 * Copy: See Copyright for the status of this software. 7 * 8 * Author: Daniel Veillard 9 */ 10 11 12 #ifndef __XML_SAX2_H__ 13 #define __XML_SAX2_H__ 14 15 #include <stdio.h> 16 #include <stdlib.h> 17 #include <libxml/xmlversion.h> 18 #include <libxml/parser.h> 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 XMLPUBFUN const xmlChar * 24 xmlSAX2GetPublicId (void *ctx); 25 XMLPUBFUN const xmlChar * 26 xmlSAX2GetSystemId (void *ctx); 27 XMLPUBFUN void 28 xmlSAX2SetDocumentLocator (void *ctx, 29 xmlSAXLocatorPtr loc); 30 31 XMLPUBFUN int 32 xmlSAX2GetLineNumber (void *ctx); 33 XMLPUBFUN int 34 xmlSAX2GetColumnNumber (void *ctx); 35 36 XMLPUBFUN int 37 xmlSAX2IsStandalone (void *ctx); 38 XMLPUBFUN int 39 xmlSAX2HasInternalSubset (void *ctx); 40 XMLPUBFUN int 41 xmlSAX2HasExternalSubset (void *ctx); 42 43 XMLPUBFUN void 44 xmlSAX2InternalSubset (void *ctx, 45 const xmlChar *name, 46 const xmlChar *ExternalID, 47 const xmlChar *SystemID); 48 XMLPUBFUN void 49 xmlSAX2ExternalSubset (void *ctx, 50 const xmlChar *name, 51 const xmlChar *ExternalID, 52 const xmlChar *SystemID); 53 XMLPUBFUN xmlEntityPtr 54 xmlSAX2GetEntity (void *ctx, 55 const xmlChar *name); 56 XMLPUBFUN xmlEntityPtr 57 xmlSAX2GetParameterEntity (void *ctx, 58 const xmlChar *name); 59 XMLPUBFUN xmlParserInputPtr 60 xmlSAX2ResolveEntity (void *ctx, 61 const xmlChar *publicId, 62 const xmlChar *systemId); 63 64 XMLPUBFUN void 65 xmlSAX2EntityDecl (void *ctx, 66 const xmlChar *name, 67 int type, 68 const xmlChar *publicId, 69 const xmlChar *systemId, 70 xmlChar *content); 71 XMLPUBFUN void 72 xmlSAX2AttributeDecl (void *ctx, 73 const xmlChar *elem, 74 const xmlChar *fullname, 75 int type, 76 int def, 77 const xmlChar *defaultValue, 78 xmlEnumerationPtr tree); 79 XMLPUBFUN void 80 xmlSAX2ElementDecl (void *ctx, 81 const xmlChar *name, 82 int type, 83 xmlElementContentPtr content); 84 XMLPUBFUN void 85 xmlSAX2NotationDecl (void *ctx, 86 const xmlChar *name, 87 const xmlChar *publicId, 88 const xmlChar *systemId); 89 XMLPUBFUN void 90 xmlSAX2UnparsedEntityDecl (void *ctx, 91 const xmlChar *name, 92 const xmlChar *publicId, 93 const xmlChar *systemId, 94 const xmlChar *notationName); 95 96 XMLPUBFUN void 97 xmlSAX2StartDocument (void *ctx); 98 XMLPUBFUN void 99 xmlSAX2EndDocument (void *ctx); 100 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ 101 defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED) 102 XMLPUBFUN void 103 xmlSAX2StartElement (void *ctx, 104 const xmlChar *fullname, 105 const xmlChar **atts); 106 XMLPUBFUN void 107 xmlSAX2EndElement (void *ctx, 108 const xmlChar *name); 109 #endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED or LIBXML_LEGACY_ENABLED */ 110 XMLPUBFUN void 111 xmlSAX2StartElementNs (void *ctx, 112 const xmlChar *localname, 113 const xmlChar *prefix, 114 const xmlChar *URI, 115 int nb_namespaces, 116 const xmlChar **namespaces, 117 int nb_attributes, 118 int nb_defaulted, 119 const xmlChar **attributes); 120 XMLPUBFUN void 121 xmlSAX2EndElementNs (void *ctx, 122 const xmlChar *localname, 123 const xmlChar *prefix, 124 const xmlChar *URI); 125 XMLPUBFUN void 126 xmlSAX2Reference (void *ctx, 127 const xmlChar *name); 128 XMLPUBFUN void 129 xmlSAX2Characters (void *ctx, 130 const xmlChar *ch, 131 int len); 132 XMLPUBFUN void 133 xmlSAX2IgnorableWhitespace (void *ctx, 134 const xmlChar *ch, 135 int len); 136 XMLPUBFUN void 137 xmlSAX2ProcessingInstruction (void *ctx, 138 const xmlChar *target, 139 const xmlChar *data); 140 XMLPUBFUN void 141 xmlSAX2Comment (void *ctx, 142 const xmlChar *value); 143 XMLPUBFUN void 144 xmlSAX2CDataBlock (void *ctx, 145 const xmlChar *value, 146 int len); 147 148 #ifdef LIBXML_SAX1_ENABLED 149 XML_DEPRECATED 150 XMLPUBFUN int 151 xmlSAXDefaultVersion (int version); 152 #endif /* LIBXML_SAX1_ENABLED */ 153 154 XMLPUBFUN int 155 xmlSAXVersion (xmlSAXHandler *hdlr, 156 int version); 157 XMLPUBFUN void 158 xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr, 159 int warning); 160 #ifdef LIBXML_HTML_ENABLED 161 XMLPUBFUN void 162 xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr); 163 XML_DEPRECATED 164 XMLPUBFUN void 165 htmlDefaultSAXHandlerInit (void); 166 #endif 167 XML_DEPRECATED 168 XMLPUBFUN void 169 xmlDefaultSAXHandlerInit (void); 170 #ifdef __cplusplus 171 } 172 #endif 173 #endif /* __XML_SAX2_H__ */ 174