Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1 | /* |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 2 | * SAX.c : Old SAX v1 handlers to build a tree. |
| 3 | * Deprecated except for compatibility |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 4 | * |
| 5 | * See Copyright for the status of this software. |
| 6 | * |
Daniel Veillard | c5d6434 | 2001-06-24 12:13:24 +0000 | [diff] [blame] | 7 | * Daniel Veillard <daniel@veillard.com> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | |
Daniel Veillard | 34ce8be | 2002-03-18 19:37:11 +0000 | [diff] [blame] | 11 | #define IN_LIBXML |
Bjorn Reese | 70a9da5 | 2001-04-21 16:57:29 +0000 | [diff] [blame] | 12 | #include "libxml.h" |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 13 | #include <stdlib.h> |
| 14 | #include <string.h> |
| 15 | #include <libxml/xmlmemory.h> |
| 16 | #include <libxml/tree.h> |
| 17 | #include <libxml/parser.h> |
| 18 | #include <libxml/parserInternals.h> |
| 19 | #include <libxml/valid.h> |
| 20 | #include <libxml/entities.h> |
| 21 | #include <libxml/xmlerror.h> |
| 22 | #include <libxml/debugXML.h> |
| 23 | #include <libxml/xmlIO.h> |
| 24 | #include <libxml/SAX.h> |
| 25 | #include <libxml/uri.h> |
Daniel Veillard | 48da910 | 2001-08-07 01:10:10 +0000 | [diff] [blame] | 26 | #include <libxml/valid.h> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 27 | #include <libxml/HTMLtree.h> |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 28 | #include <libxml/globals.h> |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 29 | #include <libxml/SAX2.h> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 30 | |
| 31 | /* #define DEBUG_SAX */ |
| 32 | /* #define DEBUG_SAX_TREE */ |
| 33 | |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 34 | static int deprecated_msg = 0; |
| 35 | |
| 36 | #define DEPRECATED(n) \ |
| 37 | if (deprecated_msg == 0) \ |
| 38 | xmlGenericError(xmlGenericErrorContext, \ |
| 39 | "Use of deprecated SAXv1 function %s\n", n); \ |
| 40 | deprecated_msg++; |
| 41 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 42 | /** |
| 43 | * getPublicId: |
| 44 | * @ctx: the user data (XML parser context) |
| 45 | * |
Daniel Veillard | a9b66d0 | 2002-12-11 14:23:49 +0000 | [diff] [blame] | 46 | * Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN" |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 47 | * DEPRECATED: use xmlSAX2GetPublicId() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 48 | * |
| 49 | * Returns a xmlChar * |
| 50 | */ |
| 51 | const xmlChar * |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 52 | getPublicId(void *ctx) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 53 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 54 | DEPRECATED("getPublicId") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 55 | return(xmlSAX2GetPublicId(ctx)); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | /** |
| 59 | * getSystemId: |
| 60 | * @ctx: the user data (XML parser context) |
| 61 | * |
Daniel Veillard | a9b66d0 | 2002-12-11 14:23:49 +0000 | [diff] [blame] | 62 | * Provides the system ID, basically URL or filename e.g. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 63 | * http://www.sgmlsource.com/dtds/memo.dtd |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 64 | * DEPRECATED: use xmlSAX2GetSystemId() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 65 | * |
| 66 | * Returns a xmlChar * |
| 67 | */ |
| 68 | const xmlChar * |
| 69 | getSystemId(void *ctx) |
| 70 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 71 | DEPRECATED("getSystemId") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 72 | return(xmlSAX2GetSystemId(ctx)); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | /** |
| 76 | * getLineNumber: |
| 77 | * @ctx: the user data (XML parser context) |
| 78 | * |
Daniel Veillard | a9b66d0 | 2002-12-11 14:23:49 +0000 | [diff] [blame] | 79 | * Provide the line number of the current parsing point. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 80 | * DEPRECATED: use xmlSAX2GetLineNumber() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 81 | * |
| 82 | * Returns an int |
| 83 | */ |
| 84 | int |
| 85 | getLineNumber(void *ctx) |
| 86 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 87 | DEPRECATED("getLineNumber") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 88 | return(xmlSAX2GetLineNumber(ctx)); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | /** |
| 92 | * getColumnNumber: |
| 93 | * @ctx: the user data (XML parser context) |
| 94 | * |
Daniel Veillard | a9b66d0 | 2002-12-11 14:23:49 +0000 | [diff] [blame] | 95 | * Provide the column number of the current parsing point. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 96 | * DEPRECATED: use xmlSAX2GetColumnNumber() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 97 | * |
| 98 | * Returns an int |
| 99 | */ |
| 100 | int |
| 101 | getColumnNumber(void *ctx) |
| 102 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 103 | DEPRECATED("getColumnNumber") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 104 | return(xmlSAX2GetColumnNumber(ctx)); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 105 | } |
| 106 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 107 | /** |
| 108 | * isStandalone: |
| 109 | * @ctx: the user data (XML parser context) |
| 110 | * |
| 111 | * Is this document tagged standalone ? |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 112 | * DEPRECATED: use xmlSAX2IsStandalone() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 113 | * |
| 114 | * Returns 1 if true |
| 115 | */ |
| 116 | int |
| 117 | isStandalone(void *ctx) |
| 118 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 119 | DEPRECATED("isStandalone") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 120 | return(xmlSAX2IsStandalone(ctx)); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | /** |
| 124 | * hasInternalSubset: |
| 125 | * @ctx: the user data (XML parser context) |
| 126 | * |
| 127 | * Does this document has an internal subset |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 128 | * DEPRECATED: use xmlSAX2HasInternalSubset() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 129 | * |
| 130 | * Returns 1 if true |
| 131 | */ |
| 132 | int |
| 133 | hasInternalSubset(void *ctx) |
| 134 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 135 | DEPRECATED("hasInternalSubset") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 136 | return(xmlSAX2HasInternalSubset(ctx)); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | /** |
| 140 | * hasExternalSubset: |
| 141 | * @ctx: the user data (XML parser context) |
| 142 | * |
| 143 | * Does this document has an external subset |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 144 | * DEPRECATED: use xmlSAX2HasExternalSubset() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 145 | * |
| 146 | * Returns 1 if true |
| 147 | */ |
| 148 | int |
| 149 | hasExternalSubset(void *ctx) |
| 150 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 151 | DEPRECATED("hasExternalSubset") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 152 | return(xmlSAX2HasExternalSubset(ctx)); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | /** |
| 156 | * internalSubset: |
| 157 | * @ctx: the user data (XML parser context) |
| 158 | * @name: the root element name |
| 159 | * @ExternalID: the external ID |
| 160 | * @SystemID: the SYSTEM ID (e.g. filename or URL) |
| 161 | * |
| 162 | * Callback on internal subset declaration. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 163 | * DEPRECATED: use xmlSAX2InternalSubset() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 164 | */ |
| 165 | void |
| 166 | internalSubset(void *ctx, const xmlChar *name, |
| 167 | const xmlChar *ExternalID, const xmlChar *SystemID) |
| 168 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 169 | DEPRECATED("internalSubset") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 170 | xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | /** |
| 174 | * externalSubset: |
| 175 | * @ctx: the user data (XML parser context) |
| 176 | * @name: the root element name |
| 177 | * @ExternalID: the external ID |
| 178 | * @SystemID: the SYSTEM ID (e.g. filename or URL) |
| 179 | * |
| 180 | * Callback on external subset declaration. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 181 | * DEPRECATED: use xmlSAX2ExternalSubset() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 182 | */ |
| 183 | void |
| 184 | externalSubset(void *ctx, const xmlChar *name, |
| 185 | const xmlChar *ExternalID, const xmlChar *SystemID) |
| 186 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 187 | DEPRECATED("externalSubset") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 188 | xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | /** |
| 192 | * resolveEntity: |
| 193 | * @ctx: the user data (XML parser context) |
| 194 | * @publicId: The public ID of the entity |
| 195 | * @systemId: The system ID of the entity |
| 196 | * |
| 197 | * The entity loader, to control the loading of external entities, |
| 198 | * the application can either: |
| 199 | * - override this resolveEntity() callback in the SAX block |
| 200 | * - or better use the xmlSetExternalEntityLoader() function to |
| 201 | * set up it's own entity resolution routine |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 202 | * DEPRECATED: use xmlSAX2ResolveEntity() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 203 | * |
| 204 | * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. |
| 205 | */ |
| 206 | xmlParserInputPtr |
| 207 | resolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId) |
| 208 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 209 | DEPRECATED("resolveEntity") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 210 | return(xmlSAX2ResolveEntity(ctx, publicId, systemId)); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 211 | } |
| 212 | |
| 213 | /** |
| 214 | * getEntity: |
| 215 | * @ctx: the user data (XML parser context) |
| 216 | * @name: The entity name |
| 217 | * |
| 218 | * Get an entity by name |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 219 | * DEPRECATED: use xmlSAX2GetEntity() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 220 | * |
| 221 | * Returns the xmlEntityPtr if found. |
| 222 | */ |
| 223 | xmlEntityPtr |
| 224 | getEntity(void *ctx, const xmlChar *name) |
| 225 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 226 | DEPRECATED("getEntity") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 227 | return(xmlSAX2GetEntity(ctx, name)); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | /** |
| 231 | * getParameterEntity: |
| 232 | * @ctx: the user data (XML parser context) |
| 233 | * @name: The entity name |
| 234 | * |
| 235 | * Get a parameter entity by name |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 236 | * DEPRECATED: use xmlSAX2GetParameterEntity() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 237 | * |
| 238 | * Returns the xmlEntityPtr if found. |
| 239 | */ |
| 240 | xmlEntityPtr |
| 241 | getParameterEntity(void *ctx, const xmlChar *name) |
| 242 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 243 | DEPRECATED("getParameterEntity") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 244 | return(xmlSAX2GetParameterEntity(ctx, name)); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 245 | } |
| 246 | |
| 247 | |
| 248 | /** |
| 249 | * entityDecl: |
| 250 | * @ctx: the user data (XML parser context) |
| 251 | * @name: the entity name |
| 252 | * @type: the entity type |
| 253 | * @publicId: The public ID of the entity |
| 254 | * @systemId: The system ID of the entity |
| 255 | * @content: the entity value (without processing). |
| 256 | * |
| 257 | * An entity definition has been parsed |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 258 | * DEPRECATED: use xmlSAX2EntityDecl() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 259 | */ |
| 260 | void |
| 261 | entityDecl(void *ctx, const xmlChar *name, int type, |
| 262 | const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) |
| 263 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 264 | DEPRECATED("entityDecl") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 265 | xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | /** |
| 269 | * attributeDecl: |
| 270 | * @ctx: the user data (XML parser context) |
| 271 | * @elem: the name of the element |
| 272 | * @fullname: the attribute name |
| 273 | * @type: the attribute type |
| 274 | * @def: the type of default value |
| 275 | * @defaultValue: the attribute default value |
| 276 | * @tree: the tree of enumerated value set |
| 277 | * |
| 278 | * An attribute definition has been parsed |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 279 | * DEPRECATED: use xmlSAX2AttributeDecl() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 280 | */ |
| 281 | void |
| 282 | attributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, |
| 283 | int type, int def, const xmlChar *defaultValue, |
| 284 | xmlEnumerationPtr tree) |
| 285 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 286 | DEPRECATED("attributeDecl") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 287 | xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue, tree); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | /** |
| 291 | * elementDecl: |
| 292 | * @ctx: the user data (XML parser context) |
| 293 | * @name: the element name |
| 294 | * @type: the element type |
| 295 | * @content: the element value tree |
| 296 | * |
| 297 | * An element definition has been parsed |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 298 | * DEPRECATED: use xmlSAX2ElementDecl() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 299 | */ |
| 300 | void |
Daniel Veillard | 1fd36d2 | 2001-07-04 22:54:28 +0000 | [diff] [blame] | 301 | elementDecl(void *ctx, const xmlChar * name, int type, |
| 302 | xmlElementContentPtr content) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 303 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 304 | DEPRECATED("elementDecl") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 305 | xmlSAX2ElementDecl(ctx, name, type, content); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | /** |
| 309 | * notationDecl: |
| 310 | * @ctx: the user data (XML parser context) |
| 311 | * @name: The name of the notation |
| 312 | * @publicId: The public ID of the entity |
| 313 | * @systemId: The system ID of the entity |
| 314 | * |
| 315 | * What to do when a notation declaration has been parsed. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 316 | * DEPRECATED: use xmlSAX2NotationDecl() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 317 | */ |
| 318 | void |
| 319 | notationDecl(void *ctx, const xmlChar *name, |
| 320 | const xmlChar *publicId, const xmlChar *systemId) |
| 321 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 322 | DEPRECATED("notationDecl") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 323 | xmlSAX2NotationDecl(ctx, name, publicId, systemId); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 324 | } |
| 325 | |
| 326 | /** |
| 327 | * unparsedEntityDecl: |
| 328 | * @ctx: the user data (XML parser context) |
| 329 | * @name: The name of the entity |
| 330 | * @publicId: The public ID of the entity |
| 331 | * @systemId: The system ID of the entity |
| 332 | * @notationName: the name of the notation |
| 333 | * |
| 334 | * What to do when an unparsed entity declaration is parsed |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 335 | * DEPRECATED: use xmlSAX2UnparsedEntityDecl() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 336 | */ |
| 337 | void |
| 338 | unparsedEntityDecl(void *ctx, const xmlChar *name, |
| 339 | const xmlChar *publicId, const xmlChar *systemId, |
| 340 | const xmlChar *notationName) |
| 341 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 342 | DEPRECATED("unparsedEntityDecl") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 343 | xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId, notationName); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | /** |
| 347 | * setDocumentLocator: |
| 348 | * @ctx: the user data (XML parser context) |
| 349 | * @loc: A SAX Locator |
| 350 | * |
| 351 | * Receive the document locator at startup, actually xmlDefaultSAXLocator |
| 352 | * Everything is available on the context, so this is useless in our case. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 353 | * DEPRECATED |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 354 | */ |
| 355 | void |
Daniel Veillard | c86a4fa | 2001-03-26 16:28:29 +0000 | [diff] [blame] | 356 | setDocumentLocator(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 357 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 358 | DEPRECATED("setDocumentLocator") |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | /** |
| 362 | * startDocument: |
| 363 | * @ctx: the user data (XML parser context) |
| 364 | * |
| 365 | * called when the document start being processed. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 366 | * DEPRECATED: use xmlSAX2StartDocument() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 367 | */ |
| 368 | void |
| 369 | startDocument(void *ctx) |
| 370 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 371 | DEPRECATED("startDocument") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 372 | xmlSAX2StartDocument(ctx); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 373 | } |
| 374 | |
| 375 | /** |
| 376 | * endDocument: |
| 377 | * @ctx: the user data (XML parser context) |
| 378 | * |
| 379 | * called when the document end has been detected. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 380 | * DEPRECATED: use xmlSAX2EndDocument() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 381 | */ |
| 382 | void |
| 383 | endDocument(void *ctx) |
| 384 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 385 | DEPRECATED("endDocument") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 386 | xmlSAX2EndDocument(ctx); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 387 | } |
| 388 | |
Daniel Veillard | 90d68fb | 2002-09-26 16:10:21 +0000 | [diff] [blame] | 389 | /** |
| 390 | * attribute: |
| 391 | * @ctx: the user data (XML parser context) |
| 392 | * @fullname: The attribute name, including namespace prefix |
| 393 | * @value: The attribute value |
| 394 | * |
| 395 | * Handle an attribute that has been read by the parser. |
| 396 | * The default handling is to convert the attribute into an |
| 397 | * DOM subtree and past it in a new xmlAttr element added to |
| 398 | * the element. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 399 | * DEPRECATED: use xmlSAX2Attribute() |
Daniel Veillard | 90d68fb | 2002-09-26 16:10:21 +0000 | [diff] [blame] | 400 | */ |
| 401 | void |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 402 | attribute(void *ctx ATTRIBUTE_UNUSED, const xmlChar *fullname ATTRIBUTE_UNUSED, const xmlChar *value ATTRIBUTE_UNUSED) |
Daniel Veillard | 90d68fb | 2002-09-26 16:10:21 +0000 | [diff] [blame] | 403 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 404 | DEPRECATED("attribute") |
Daniel Veillard | 878eab0 | 2002-02-19 13:46:09 +0000 | [diff] [blame] | 405 | } |
| 406 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 407 | /** |
| 408 | * startElement: |
| 409 | * @ctx: the user data (XML parser context) |
| 410 | * @fullname: The element name, including namespace prefix |
| 411 | * @atts: An array of name/value attributes pairs, NULL terminated |
| 412 | * |
| 413 | * called when an opening tag has been processed. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 414 | * DEPRECATED: use xmlSAX2StartElement() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 415 | */ |
| 416 | void |
| 417 | startElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) |
| 418 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 419 | DEPRECATED("startElement") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 420 | xmlSAX2StartElement(ctx, fullname, atts); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 421 | } |
| 422 | |
| 423 | /** |
| 424 | * endElement: |
| 425 | * @ctx: the user data (XML parser context) |
| 426 | * @name: The element name |
| 427 | * |
| 428 | * called when the end of an element has been detected. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 429 | * DEPRECATED: use xmlSAX2EndElement() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 430 | */ |
| 431 | void |
Daniel Veillard | c86a4fa | 2001-03-26 16:28:29 +0000 | [diff] [blame] | 432 | endElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 433 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 434 | DEPRECATED("endElement") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 435 | xmlSAX2EndElement(ctx, name); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 436 | } |
| 437 | |
| 438 | /** |
| 439 | * reference: |
| 440 | * @ctx: the user data (XML parser context) |
| 441 | * @name: The entity name |
| 442 | * |
| 443 | * called when an entity reference is detected. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 444 | * DEPRECATED: use xmlSAX2Reference() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 445 | */ |
| 446 | void |
| 447 | reference(void *ctx, const xmlChar *name) |
| 448 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 449 | DEPRECATED("reference") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 450 | xmlSAX2Reference(ctx, name); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 451 | } |
| 452 | |
| 453 | /** |
| 454 | * characters: |
| 455 | * @ctx: the user data (XML parser context) |
| 456 | * @ch: a xmlChar string |
| 457 | * @len: the number of xmlChar |
| 458 | * |
| 459 | * receiving some chars from the parser. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 460 | * DEPRECATED: use xmlSAX2Characters() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 461 | */ |
| 462 | void |
| 463 | characters(void *ctx, const xmlChar *ch, int len) |
| 464 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 465 | DEPRECATED("characters") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 466 | xmlSAX2Characters(ctx, ch, len); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 467 | } |
| 468 | |
| 469 | /** |
| 470 | * ignorableWhitespace: |
| 471 | * @ctx: the user data (XML parser context) |
| 472 | * @ch: a xmlChar string |
| 473 | * @len: the number of xmlChar |
| 474 | * |
| 475 | * receiving some ignorable whitespaces from the parser. |
Daniel Veillard | 05c13a2 | 2001-09-09 08:38:09 +0000 | [diff] [blame] | 476 | * UNUSED: by default the DOM building will use characters |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 477 | * DEPRECATED: use xmlSAX2IgnorableWhitespace() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 478 | */ |
| 479 | void |
Daniel Veillard | c86a4fa | 2001-03-26 16:28:29 +0000 | [diff] [blame] | 480 | ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 481 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 482 | DEPRECATED("ignorableWhitespace") |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 483 | } |
| 484 | |
| 485 | /** |
| 486 | * processingInstruction: |
| 487 | * @ctx: the user data (XML parser context) |
| 488 | * @target: the target name |
| 489 | * @data: the PI data's |
| 490 | * |
| 491 | * A processing instruction has been parsed. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 492 | * DEPRECATED: use xmlSAX2ProcessingInstruction() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 493 | */ |
| 494 | void |
| 495 | processingInstruction(void *ctx, const xmlChar *target, |
| 496 | const xmlChar *data) |
| 497 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 498 | DEPRECATED("processingInstruction") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 499 | xmlSAX2ProcessingInstruction(ctx, target, data); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 500 | } |
| 501 | |
| 502 | /** |
| 503 | * globalNamespace: |
| 504 | * @ctx: the user data (XML parser context) |
| 505 | * @href: the namespace associated URN |
| 506 | * @prefix: the namespace prefix |
| 507 | * |
| 508 | * An old global namespace has been parsed. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 509 | * DEPRECATED |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 510 | */ |
| 511 | void |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 512 | globalNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 513 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 514 | DEPRECATED("globalNamespace") |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 515 | } |
| 516 | |
| 517 | /** |
| 518 | * setNamespace: |
| 519 | * @ctx: the user data (XML parser context) |
| 520 | * @name: the namespace prefix |
| 521 | * |
| 522 | * Set the current element namespace. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 523 | * DEPRECATED |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 524 | */ |
| 525 | |
| 526 | void |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 527 | setNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name ATTRIBUTE_UNUSED) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 528 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 529 | DEPRECATED("setNamespace") |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 530 | } |
| 531 | |
| 532 | /** |
| 533 | * getNamespace: |
| 534 | * @ctx: the user data (XML parser context) |
| 535 | * |
| 536 | * Get the current element namespace. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 537 | * DEPRECATED |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 538 | * |
| 539 | * Returns the xmlNsPtr or NULL if none |
| 540 | */ |
| 541 | |
| 542 | xmlNsPtr |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 543 | getNamespace(void *ctx ATTRIBUTE_UNUSED) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 544 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 545 | DEPRECATED("getNamespace") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 546 | return(NULL); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 547 | } |
| 548 | |
| 549 | /** |
| 550 | * checkNamespace: |
| 551 | * @ctx: the user data (XML parser context) |
| 552 | * @namespace: the namespace to check against |
| 553 | * |
| 554 | * Check that the current element namespace is the same as the |
| 555 | * one read upon parsing. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 556 | * DEPRECATED |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 557 | * |
| 558 | * Returns 1 if true 0 otherwise |
| 559 | */ |
| 560 | |
| 561 | int |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 562 | checkNamespace(void *ctx ATTRIBUTE_UNUSED, xmlChar *namespace ATTRIBUTE_UNUSED) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 563 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 564 | DEPRECATED("checkNamespace") |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 565 | return(0); |
| 566 | } |
| 567 | |
| 568 | /** |
| 569 | * namespaceDecl: |
| 570 | * @ctx: the user data (XML parser context) |
| 571 | * @href: the namespace associated URN |
| 572 | * @prefix: the namespace prefix |
| 573 | * |
| 574 | * A namespace has been parsed. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 575 | * DEPRECATED |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 576 | */ |
| 577 | void |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 578 | namespaceDecl(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 579 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 580 | DEPRECATED("namespaceDecl") |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 581 | } |
| 582 | |
| 583 | /** |
| 584 | * comment: |
| 585 | * @ctx: the user data (XML parser context) |
| 586 | * @value: the comment content |
| 587 | * |
| 588 | * A comment has been parsed. |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 589 | * DEPRECATED: use xmlSAX2Comment() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 590 | */ |
| 591 | void |
| 592 | comment(void *ctx, const xmlChar *value) |
| 593 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 594 | DEPRECATED("comment") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 595 | xmlSAX2Comment(ctx, value); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 596 | } |
| 597 | |
| 598 | /** |
| 599 | * cdataBlock: |
| 600 | * @ctx: the user data (XML parser context) |
| 601 | * @value: The pcdata content |
| 602 | * @len: the block length |
| 603 | * |
| 604 | * called when a pcdata block has been parsed |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 605 | * DEPRECATED: use xmlSAX2CDataBlock() |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 606 | */ |
| 607 | void |
| 608 | cdataBlock(void *ctx, const xmlChar *value, int len) |
| 609 | { |
Daniel Veillard | 11af429 | 2003-08-21 10:39:13 +0000 | [diff] [blame] | 610 | DEPRECATED("cdataBlock") |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 611 | xmlSAX2CDataBlock(ctx, value, len); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 612 | } |
| 613 | |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 614 | /** |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 615 | * initxmlDefaultSAXHandler: |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 616 | * @hdlr: the SAX handler |
| 617 | * @warning: flag if non-zero sets the handler warning procedure |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 618 | * |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 619 | * Initialize the default XML SAX version 1 handler |
| 620 | * DEPRECATED: use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 621 | */ |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 622 | void |
| 623 | initxmlDefaultSAXHandler(xmlSAXHandler *hdlr, int warning) |
| 624 | { |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 625 | |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 626 | if(hdlr->initialized == 1) |
| 627 | return; |
| 628 | |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 629 | hdlr->internalSubset = xmlSAX2InternalSubset; |
| 630 | hdlr->externalSubset = xmlSAX2ExternalSubset; |
| 631 | hdlr->isStandalone = xmlSAX2IsStandalone; |
| 632 | hdlr->hasInternalSubset = xmlSAX2HasInternalSubset; |
| 633 | hdlr->hasExternalSubset = xmlSAX2HasExternalSubset; |
| 634 | hdlr->resolveEntity = xmlSAX2ResolveEntity; |
| 635 | hdlr->getEntity = xmlSAX2GetEntity; |
| 636 | hdlr->getParameterEntity = xmlSAX2GetParameterEntity; |
| 637 | hdlr->entityDecl = xmlSAX2EntityDecl; |
| 638 | hdlr->attributeDecl = xmlSAX2AttributeDecl; |
| 639 | hdlr->elementDecl = xmlSAX2ElementDecl; |
| 640 | hdlr->notationDecl = xmlSAX2NotationDecl; |
| 641 | hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl; |
| 642 | hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator; |
| 643 | hdlr->startDocument = xmlSAX2StartDocument; |
| 644 | hdlr->endDocument = xmlSAX2EndDocument; |
| 645 | hdlr->startElement = xmlSAX2StartElement; |
| 646 | hdlr->endElement = xmlSAX2EndElement; |
| 647 | hdlr->reference = xmlSAX2Reference; |
| 648 | hdlr->characters = xmlSAX2Characters; |
| 649 | hdlr->cdataBlock = xmlSAX2CDataBlock; |
| 650 | hdlr->ignorableWhitespace = xmlSAX2Characters; |
| 651 | hdlr->processingInstruction = xmlSAX2ProcessingInstruction; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 652 | if (warning == 0) |
| 653 | hdlr->warning = NULL; |
| 654 | else |
| 655 | hdlr->warning = xmlParserWarning; |
| 656 | hdlr->error = xmlParserError; |
| 657 | hdlr->fatalError = xmlParserError; |
| 658 | |
| 659 | hdlr->initialized = 1; |
| 660 | } |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 661 | |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 662 | #ifdef LIBXML_HTML_ENABLED |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 663 | |
| 664 | /** |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 665 | * inithtmlDefaultSAXHandler: |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 666 | * @hdlr: the SAX handler |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 667 | * |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 668 | * Initialize the default HTML SAX version 1 handler |
| 669 | * DEPRECATED: use xmlSAX2InitHtmlDefaultSAXHandler() for the new SAX2 blocks |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 670 | */ |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 671 | void |
| 672 | inithtmlDefaultSAXHandler(xmlSAXHandler *hdlr) |
| 673 | { |
| 674 | if(hdlr->initialized == 1) |
| 675 | return; |
| 676 | |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 677 | hdlr->internalSubset = xmlSAX2InternalSubset; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 678 | hdlr->externalSubset = NULL; |
| 679 | hdlr->isStandalone = NULL; |
| 680 | hdlr->hasInternalSubset = NULL; |
| 681 | hdlr->hasExternalSubset = NULL; |
| 682 | hdlr->resolveEntity = NULL; |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 683 | hdlr->getEntity = xmlSAX2GetEntity; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 684 | hdlr->getParameterEntity = NULL; |
| 685 | hdlr->entityDecl = NULL; |
| 686 | hdlr->attributeDecl = NULL; |
| 687 | hdlr->elementDecl = NULL; |
| 688 | hdlr->notationDecl = NULL; |
| 689 | hdlr->unparsedEntityDecl = NULL; |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 690 | hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator; |
| 691 | hdlr->startDocument = xmlSAX2StartDocument; |
| 692 | hdlr->endDocument = xmlSAX2EndDocument; |
| 693 | hdlr->startElement = xmlSAX2StartElement; |
| 694 | hdlr->endElement = xmlSAX2EndElement; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 695 | hdlr->reference = NULL; |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 696 | hdlr->characters = xmlSAX2Characters; |
| 697 | hdlr->cdataBlock = xmlSAX2CDataBlock; |
| 698 | hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 699 | hdlr->processingInstruction = NULL; |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 700 | hdlr->comment = xmlSAX2Comment; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 701 | hdlr->warning = xmlParserWarning; |
| 702 | hdlr->error = xmlParserError; |
| 703 | hdlr->fatalError = xmlParserError; |
| 704 | |
| 705 | hdlr->initialized = 1; |
| 706 | } |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 707 | |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 708 | #endif /* LIBXML_HTML_ENABLED */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 709 | |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 710 | #ifdef LIBXML_DOCB_ENABLED |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 711 | |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 712 | /** |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 713 | * initdocbDefaultSAXHandler: |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 714 | * @hdlr: the SAX handler |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 715 | * |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 716 | * Initialize the default DocBook SAX version 1 handler |
| 717 | * DEPRECATED: use xmlSAX2InitDocbDefaultSAXHandler() for the new SAX2 blocks |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 718 | */ |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 719 | void |
| 720 | initdocbDefaultSAXHandler(xmlSAXHandler *hdlr) |
| 721 | { |
| 722 | if(hdlr->initialized == 1) |
| 723 | return; |
| 724 | |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 725 | hdlr->internalSubset = xmlSAX2InternalSubset; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 726 | hdlr->externalSubset = NULL; |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 727 | hdlr->isStandalone = xmlSAX2IsStandalone; |
| 728 | hdlr->hasInternalSubset = xmlSAX2HasInternalSubset; |
| 729 | hdlr->hasExternalSubset = xmlSAX2HasExternalSubset; |
| 730 | hdlr->resolveEntity = xmlSAX2ResolveEntity; |
| 731 | hdlr->getEntity = xmlSAX2GetEntity; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 732 | hdlr->getParameterEntity = NULL; |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 733 | hdlr->entityDecl = xmlSAX2EntityDecl; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 734 | hdlr->attributeDecl = NULL; |
| 735 | hdlr->elementDecl = NULL; |
| 736 | hdlr->notationDecl = NULL; |
| 737 | hdlr->unparsedEntityDecl = NULL; |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 738 | hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator; |
| 739 | hdlr->startDocument = xmlSAX2StartDocument; |
| 740 | hdlr->endDocument = xmlSAX2EndDocument; |
| 741 | hdlr->startElement = xmlSAX2StartElement; |
| 742 | hdlr->endElement = xmlSAX2EndElement; |
| 743 | hdlr->reference = xmlSAX2Reference; |
| 744 | hdlr->characters = xmlSAX2Characters; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 745 | hdlr->cdataBlock = NULL; |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 746 | hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 747 | hdlr->processingInstruction = NULL; |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 748 | hdlr->comment = xmlSAX2Comment; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 749 | hdlr->warning = xmlParserWarning; |
| 750 | hdlr->error = xmlParserError; |
| 751 | hdlr->fatalError = xmlParserError; |
| 752 | |
| 753 | hdlr->initialized = 1; |
| 754 | } |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 755 | |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 756 | #endif /* LIBXML_DOCB_ENABLED */ |