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