Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * parser.h : Interfaces, constants and types related to the XML parser. |
| 3 | * |
| 4 | * See Copyright for the status of this software. |
| 5 | * |
Daniel Veillard | c5d6434 | 2001-06-24 12:13:24 +0000 | [diff] [blame] | 6 | * daniel@veillard.com |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __XML_PARSER_H__ |
| 10 | #define __XML_PARSER_H__ |
| 11 | |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 12 | #include <libxml/xmlversion.h> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 13 | #include <libxml/tree.h> |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 14 | #include <libxml/dict.h> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 15 | #include <libxml/valid.h> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 16 | #include <libxml/entities.h> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 17 | |
| 18 | #ifdef __cplusplus |
| 19 | extern "C" { |
| 20 | #endif |
| 21 | |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 22 | /** |
| 23 | * XML_DEFAULT_VERSION: |
| 24 | * |
| 25 | * The default version of XML used: 1.0 |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 26 | */ |
| 27 | #define XML_DEFAULT_VERSION "1.0" |
| 28 | |
| 29 | /** |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 30 | * xmlParserInput: |
| 31 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 32 | * An xmlParserInput is an input flow for the XML processor. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 33 | * Each entity parsed is associated an xmlParserInput (except the |
| 34 | * few predefined ones). This is the case both for internal entities |
| 35 | * - in which case the flow is already completely in memory - or |
| 36 | * external entities - in which case we use the buf structure for |
| 37 | * progressive reading and I18N conversions to the internal UTF-8 format. |
| 38 | */ |
| 39 | |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 40 | /** |
| 41 | * xmlParserInputDeallocate: |
| 42 | * @str: the string to deallocate |
| 43 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 44 | * Callback for freeing some parser input allocations. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 45 | */ |
| 46 | typedef void (* xmlParserInputDeallocate)(xmlChar *str); |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 47 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 48 | struct _xmlParserInput { |
| 49 | /* Input buffer */ |
| 50 | xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */ |
| 51 | |
| 52 | const char *filename; /* The file analyzed, if any */ |
Daniel Veillard | 60087f3 | 2001-10-10 09:45:09 +0000 | [diff] [blame] | 53 | const char *directory; /* the directory/base of the file */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 54 | const xmlChar *base; /* Base of the array to parse */ |
| 55 | const xmlChar *cur; /* Current char being parsed */ |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 56 | const xmlChar *end; /* end of the array to parse */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 57 | int length; /* length if known */ |
| 58 | int line; /* Current line */ |
| 59 | int col; /* Current column */ |
Daniel Veillard | 3e59fc5 | 2003-04-18 12:34:58 +0000 | [diff] [blame] | 60 | /* |
| 61 | * NOTE: consumed is only tested for equality in the parser code, |
| 62 | * so even if there is an overflow this should not give troubles |
| 63 | * for parsing very large instances. |
| 64 | */ |
| 65 | unsigned long consumed; /* How many xmlChars already consumed */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 66 | xmlParserInputDeallocate free; /* function to deallocate the base */ |
| 67 | const xmlChar *encoding; /* the encoding string for entity */ |
| 68 | const xmlChar *version; /* the version string for entity */ |
| 69 | int standalone; /* Was that entity marked standalone */ |
| 70 | }; |
| 71 | |
| 72 | /** |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 73 | * xmlParserNodeInfo: |
| 74 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 75 | * The parser can be asked to collect Node informations, i.e. at what |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 76 | * place in the file they were detected. |
| 77 | * NOTE: This is off by default and not very well tested. |
| 78 | */ |
| 79 | typedef struct _xmlParserNodeInfo xmlParserNodeInfo; |
| 80 | typedef xmlParserNodeInfo *xmlParserNodeInfoPtr; |
| 81 | |
| 82 | struct _xmlParserNodeInfo { |
| 83 | const struct _xmlNode* node; |
| 84 | /* Position & line # that text that created the node begins & ends on */ |
| 85 | unsigned long begin_pos; |
| 86 | unsigned long begin_line; |
| 87 | unsigned long end_pos; |
| 88 | unsigned long end_line; |
| 89 | }; |
| 90 | |
| 91 | typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq; |
| 92 | typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr; |
| 93 | struct _xmlParserNodeInfoSeq { |
| 94 | unsigned long maximum; |
| 95 | unsigned long length; |
| 96 | xmlParserNodeInfo* buffer; |
| 97 | }; |
| 98 | |
| 99 | /** |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 100 | * xmlParserInputState: |
| 101 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 102 | * The parser is now working also as a state based parser. |
| 103 | * The recursive one use the state info for entities processing. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 104 | */ |
| 105 | typedef enum { |
| 106 | XML_PARSER_EOF = -1, /* nothing is to be parsed */ |
| 107 | XML_PARSER_START = 0, /* nothing has been parsed */ |
| 108 | XML_PARSER_MISC, /* Misc* before int subset */ |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 109 | XML_PARSER_PI, /* Within a processing instruction */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 110 | XML_PARSER_DTD, /* within some DTD content */ |
| 111 | XML_PARSER_PROLOG, /* Misc* after internal subset */ |
| 112 | XML_PARSER_COMMENT, /* within a comment */ |
| 113 | XML_PARSER_START_TAG, /* within a start tag */ |
| 114 | XML_PARSER_CONTENT, /* within the content */ |
| 115 | XML_PARSER_CDATA_SECTION, /* within a CDATA section */ |
| 116 | XML_PARSER_END_TAG, /* within a closing tag */ |
| 117 | XML_PARSER_ENTITY_DECL, /* within an entity declaration */ |
| 118 | XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */ |
| 119 | XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */ |
| 120 | XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */ |
| 121 | XML_PARSER_EPILOG, /* the Misc* after the last end tag */ |
Daniel Veillard | 4a7ae50 | 2002-02-18 19:18:17 +0000 | [diff] [blame] | 122 | XML_PARSER_IGNORE, /* within an IGNORED section */ |
| 123 | XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 124 | } xmlParserInputState; |
| 125 | |
| 126 | /** |
Daniel Veillard | d16df9f | 2001-05-23 13:44:21 +0000 | [diff] [blame] | 127 | * XML_DETECT_IDS: |
| 128 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 129 | * Bit in the loadsubset context field to tell to do ID/REFs lookups. |
| 130 | * Use it to initialize xmlLoadExtDtdDefaultValue. |
Daniel Veillard | d16df9f | 2001-05-23 13:44:21 +0000 | [diff] [blame] | 131 | */ |
| 132 | #define XML_DETECT_IDS 2 |
| 133 | |
| 134 | /** |
| 135 | * XML_COMPLETE_ATTRS: |
| 136 | * |
| 137 | * Bit in the loadsubset context field to tell to do complete the |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 138 | * elements attributes lists with the ones defaulted from the DTDs. |
| 139 | * Use it to initialize xmlLoadExtDtdDefaultValue. |
Daniel Veillard | d16df9f | 2001-05-23 13:44:21 +0000 | [diff] [blame] | 140 | */ |
| 141 | #define XML_COMPLETE_ATTRS 4 |
| 142 | |
| 143 | /** |
Daniel Veillard | ef8dd7b | 2003-03-23 12:02:56 +0000 | [diff] [blame] | 144 | * XML_SKIP_IDS: |
| 145 | * |
| 146 | * Bit in the loadsubset context field to tell to not do ID/REFs registration. |
| 147 | * Used to initialize xmlLoadExtDtdDefaultValue in some special cases. |
| 148 | */ |
| 149 | #define XML_SKIP_IDS 8 |
| 150 | |
| 151 | /** |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 152 | * xmlParserCtxt: |
| 153 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 154 | * The parser context. |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 155 | * NOTE This doesn't completely define the parser state, the (current ?) |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 156 | * design of the parser uses recursive function calls since this allow |
| 157 | * and easy mapping from the production rules of the specification |
| 158 | * to the actual code. The drawback is that the actual function call |
| 159 | * also reflect the parser state. However most of the parsing routines |
| 160 | * takes as the only argument the parser context pointer, so migrating |
| 161 | * to a state based parser for progressive parsing shouldn't be too hard. |
| 162 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 163 | struct _xmlParserCtxt { |
| 164 | struct _xmlSAXHandler *sax; /* The SAX handler */ |
| 165 | void *userData; /* For SAX interface only, used by DOM build */ |
| 166 | xmlDocPtr myDoc; /* the document being built */ |
| 167 | int wellFormed; /* is the document well formed */ |
| 168 | int replaceEntities; /* shall we replace entities ? */ |
| 169 | const xmlChar *version; /* the XML version string */ |
| 170 | const xmlChar *encoding; /* the declared encoding, if any */ |
| 171 | int standalone; /* standalone document */ |
| 172 | int html; /* an HTML(1)/Docbook(2) document */ |
| 173 | |
| 174 | /* Input stream stack */ |
| 175 | xmlParserInputPtr input; /* Current input stream */ |
| 176 | int inputNr; /* Number of current input streams */ |
| 177 | int inputMax; /* Max number of input streams */ |
| 178 | xmlParserInputPtr *inputTab; /* stack of inputs */ |
| 179 | |
| 180 | /* Node analysis stack only used for DOM building */ |
| 181 | xmlNodePtr node; /* Current parsed Node */ |
| 182 | int nodeNr; /* Depth of the parsing stack */ |
| 183 | int nodeMax; /* Max depth of the parsing stack */ |
| 184 | xmlNodePtr *nodeTab; /* array of nodes */ |
| 185 | |
| 186 | int record_info; /* Whether node info should be kept */ |
| 187 | xmlParserNodeInfoSeq node_seq; /* info about each node parsed */ |
| 188 | |
| 189 | int errNo; /* error code */ |
| 190 | |
| 191 | int hasExternalSubset; /* reference and external subset */ |
| 192 | int hasPErefs; /* the internal subset has PE refs */ |
| 193 | int external; /* are we parsing an external entity */ |
| 194 | |
| 195 | int valid; /* is the document valid */ |
| 196 | int validate; /* shall we try to validate ? */ |
| 197 | xmlValidCtxt vctxt; /* The validity context */ |
| 198 | |
| 199 | xmlParserInputState instate; /* current type of input */ |
| 200 | int token; /* next char look-ahead */ |
| 201 | |
| 202 | char *directory; /* the data directory */ |
| 203 | |
| 204 | /* Node name stack */ |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 205 | const xmlChar *name; /* Current parsed Node */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 206 | int nameNr; /* Depth of the parsing stack */ |
| 207 | int nameMax; /* Max depth of the parsing stack */ |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 208 | const xmlChar * *nameTab; /* array of nodes */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 209 | |
| 210 | long nbChars; /* number of xmlChar processed */ |
| 211 | long checkIndex; /* used by progressive parsing lookup */ |
| 212 | int keepBlanks; /* ugly but ... */ |
| 213 | int disableSAX; /* SAX callbacks are disabled */ |
| 214 | int inSubset; /* Parsing is in int 1/ext 2 subset */ |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 215 | const xmlChar * intSubName; /* name of subset */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 216 | xmlChar * extSubURI; /* URI of external subset */ |
| 217 | xmlChar * extSubSystem; /* SYSTEM ID of external subset */ |
| 218 | |
| 219 | /* xml:space values */ |
| 220 | int * space; /* Should the parser preserve spaces */ |
| 221 | int spaceNr; /* Depth of the parsing stack */ |
| 222 | int spaceMax; /* Max depth of the parsing stack */ |
| 223 | int * spaceTab; /* array of space infos */ |
| 224 | |
| 225 | int depth; /* to prevent entity substitution loops */ |
| 226 | xmlParserInputPtr entity; /* used to check entities boundaries */ |
| 227 | int charset; /* encoding of the in-memory content |
| 228 | actually an xmlCharEncoding */ |
| 229 | int nodelen; /* Those two fields are there to */ |
| 230 | int nodemem; /* Speed up large node parsing */ |
| 231 | int pedantic; /* signal pedantic warnings */ |
| 232 | void *_private; /* For user data, libxml won't touch it */ |
| 233 | |
| 234 | int loadsubset; /* should the external subset be loaded */ |
Daniel Veillard | d9bad13 | 2001-07-23 19:39:43 +0000 | [diff] [blame] | 235 | int linenumbers; /* set line number in element content */ |
Daniel Veillard | 5d90b6c | 2001-08-22 14:29:45 +0000 | [diff] [blame] | 236 | void *catalogs; /* document's own catalog */ |
Daniel Veillard | dad3f68 | 2002-11-17 16:47:27 +0000 | [diff] [blame] | 237 | int recovery; /* run in recovery mode */ |
Daniel Veillard | a880b12 | 2003-04-21 21:36:41 +0000 | [diff] [blame] | 238 | int progressive; /* is this a progressive parsing */ |
Daniel Veillard | 2fdbd32 | 2003-08-18 12:15:38 +0000 | [diff] [blame] | 239 | xmlDictPtr dict; /* dictionnary for the parser */ |
Daniel Veillard | 40412cd | 2003-09-03 13:28:32 +0000 | [diff] [blame^] | 240 | const xmlChar * *atts; /* array for the attributes callbacks */ |
Daniel Veillard | 6155d8a | 2003-08-19 15:01:28 +0000 | [diff] [blame] | 241 | int maxatts; /* the size of the array */ |
Daniel Veillard | 40412cd | 2003-09-03 13:28:32 +0000 | [diff] [blame^] | 242 | int docdict; /* use strings from dict to build tree */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 243 | }; |
| 244 | |
| 245 | /** |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 246 | * xmlSAXLocator: |
| 247 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 248 | * A SAX Locator. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 249 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 250 | struct _xmlSAXLocator { |
| 251 | const xmlChar *(*getPublicId)(void *ctx); |
| 252 | const xmlChar *(*getSystemId)(void *ctx); |
| 253 | int (*getLineNumber)(void *ctx); |
| 254 | int (*getColumnNumber)(void *ctx); |
| 255 | }; |
| 256 | |
| 257 | /** |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 258 | * xmlSAXHandler: |
| 259 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 260 | * A SAX handler is bunch of callbacks called by the parser when processing |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 261 | * of the input generate data or structure informations. |
| 262 | */ |
| 263 | |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 264 | /** |
| 265 | * resolveEntitySAXFunc: |
| 266 | * @ctx: the user data (XML parser context) |
| 267 | * @publicId: The public ID of the entity |
| 268 | * @systemId: The system ID of the entity |
| 269 | * |
| 270 | * Callback: |
| 271 | * The entity loader, to control the loading of external entities, |
| 272 | * the application can either: |
| 273 | * - override this resolveEntity() callback in the SAX block |
| 274 | * - or better use the xmlSetExternalEntityLoader() function to |
| 275 | * set up it's own entity resolution routine |
| 276 | * |
| 277 | * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. |
| 278 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 279 | typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx, |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 280 | const xmlChar *publicId, |
| 281 | const xmlChar *systemId); |
| 282 | /** |
| 283 | * internalSubsetSAXFunc: |
| 284 | * @ctx: the user data (XML parser context) |
| 285 | * @name: the root element name |
| 286 | * @ExternalID: the external ID |
| 287 | * @SystemID: the SYSTEM ID (e.g. filename or URL) |
| 288 | * |
| 289 | * Callback on internal subset declaration. |
| 290 | */ |
| 291 | typedef void (*internalSubsetSAXFunc) (void *ctx, |
| 292 | const xmlChar *name, |
| 293 | const xmlChar *ExternalID, |
| 294 | const xmlChar *SystemID); |
| 295 | /** |
| 296 | * externalSubsetSAXFunc: |
| 297 | * @ctx: the user data (XML parser context) |
| 298 | * @name: the root element name |
| 299 | * @ExternalID: the external ID |
| 300 | * @SystemID: the SYSTEM ID (e.g. filename or URL) |
| 301 | * |
| 302 | * Callback on external subset declaration. |
| 303 | */ |
| 304 | typedef void (*externalSubsetSAXFunc) (void *ctx, |
| 305 | const xmlChar *name, |
| 306 | const xmlChar *ExternalID, |
| 307 | const xmlChar *SystemID); |
| 308 | /** |
| 309 | * getEntitySAXFunc: |
| 310 | * @ctx: the user data (XML parser context) |
| 311 | * @name: The entity name |
| 312 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 313 | * Get an entity by name. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 314 | * |
| 315 | * Returns the xmlEntityPtr if found. |
| 316 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 317 | typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx, |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 318 | const xmlChar *name); |
| 319 | /** |
| 320 | * getParameterEntitySAXFunc: |
| 321 | * @ctx: the user data (XML parser context) |
| 322 | * @name: The entity name |
| 323 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 324 | * Get a parameter entity by name. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 325 | * |
| 326 | * Returns the xmlEntityPtr if found. |
| 327 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 328 | typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx, |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 329 | const xmlChar *name); |
| 330 | /** |
| 331 | * entityDeclSAXFunc: |
| 332 | * @ctx: the user data (XML parser context) |
| 333 | * @name: the entity name |
| 334 | * @type: the entity type |
| 335 | * @publicId: The public ID of the entity |
| 336 | * @systemId: The system ID of the entity |
| 337 | * @content: the entity value (without processing). |
| 338 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 339 | * An entity definition has been parsed. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 340 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 341 | typedef void (*entityDeclSAXFunc) (void *ctx, |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 342 | const xmlChar *name, |
| 343 | int type, |
| 344 | const xmlChar *publicId, |
| 345 | const xmlChar *systemId, |
| 346 | xmlChar *content); |
| 347 | /** |
| 348 | * notationDeclSAXFunc: |
| 349 | * @ctx: the user data (XML parser context) |
| 350 | * @name: The name of the notation |
| 351 | * @publicId: The public ID of the entity |
| 352 | * @systemId: The system ID of the entity |
| 353 | * |
| 354 | * What to do when a notation declaration has been parsed. |
| 355 | */ |
| 356 | typedef void (*notationDeclSAXFunc)(void *ctx, |
| 357 | const xmlChar *name, |
| 358 | const xmlChar *publicId, |
| 359 | const xmlChar *systemId); |
| 360 | /** |
| 361 | * attributeDeclSAXFunc: |
| 362 | * @ctx: the user data (XML parser context) |
| 363 | * @elem: the name of the element |
| 364 | * @fullname: the attribute name |
| 365 | * @type: the attribute type |
| 366 | * @def: the type of default value |
| 367 | * @defaultValue: the attribute default value |
| 368 | * @tree: the tree of enumerated value set |
| 369 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 370 | * An attribute definition has been parsed. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 371 | */ |
| 372 | typedef void (*attributeDeclSAXFunc)(void *ctx, |
| 373 | const xmlChar *elem, |
| 374 | const xmlChar *fullname, |
| 375 | int type, |
| 376 | int def, |
| 377 | const xmlChar *defaultValue, |
| 378 | xmlEnumerationPtr tree); |
| 379 | /** |
| 380 | * elementDeclSAXFunc: |
| 381 | * @ctx: the user data (XML parser context) |
| 382 | * @name: the element name |
| 383 | * @type: the element type |
| 384 | * @content: the element value tree |
| 385 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 386 | * An element definition has been parsed. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 387 | */ |
| 388 | typedef void (*elementDeclSAXFunc)(void *ctx, |
| 389 | const xmlChar *name, |
| 390 | int type, |
| 391 | xmlElementContentPtr content); |
| 392 | /** |
| 393 | * unparsedEntityDeclSAXFunc: |
| 394 | * @ctx: the user data (XML parser context) |
| 395 | * @name: The name of the entity |
| 396 | * @publicId: The public ID of the entity |
| 397 | * @systemId: The system ID of the entity |
| 398 | * @notationName: the name of the notation |
| 399 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 400 | * What to do when an unparsed entity declaration is parsed. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 401 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 402 | typedef void (*unparsedEntityDeclSAXFunc)(void *ctx, |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 403 | const xmlChar *name, |
| 404 | const xmlChar *publicId, |
| 405 | const xmlChar *systemId, |
| 406 | const xmlChar *notationName); |
| 407 | /** |
| 408 | * setDocumentLocatorSAXFunc: |
| 409 | * @ctx: the user data (XML parser context) |
| 410 | * @loc: A SAX Locator |
| 411 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 412 | * Receive the document locator at startup, actually xmlDefaultSAXLocator. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 413 | * Everything is available on the context, so this is useless in our case. |
| 414 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 415 | typedef void (*setDocumentLocatorSAXFunc) (void *ctx, |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 416 | xmlSAXLocatorPtr loc); |
| 417 | /** |
| 418 | * startDocumentSAXFunc: |
| 419 | * @ctx: the user data (XML parser context) |
| 420 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 421 | * Called when the document start being processed. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 422 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 423 | typedef void (*startDocumentSAXFunc) (void *ctx); |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 424 | /** |
| 425 | * endDocumentSAXFunc: |
| 426 | * @ctx: the user data (XML parser context) |
| 427 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 428 | * Called when the document end has been detected. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 429 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 430 | typedef void (*endDocumentSAXFunc) (void *ctx); |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 431 | /** |
| 432 | * startElementSAXFunc: |
| 433 | * @ctx: the user data (XML parser context) |
| 434 | * @name: The element name, including namespace prefix |
| 435 | * @atts: An array of name/value attributes pairs, NULL terminated |
| 436 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 437 | * Called when an opening tag has been processed. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 438 | */ |
| 439 | typedef void (*startElementSAXFunc) (void *ctx, |
| 440 | const xmlChar *name, |
| 441 | const xmlChar **atts); |
| 442 | /** |
| 443 | * endElementSAXFunc: |
| 444 | * @ctx: the user data (XML parser context) |
| 445 | * @name: The element name |
| 446 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 447 | * Called when the end of an element has been detected. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 448 | */ |
| 449 | typedef void (*endElementSAXFunc) (void *ctx, |
| 450 | const xmlChar *name); |
| 451 | /** |
| 452 | * attributeSAXFunc: |
| 453 | * @ctx: the user data (XML parser context) |
| 454 | * @name: The attribute name, including namespace prefix |
| 455 | * @value: The attribute value |
| 456 | * |
| 457 | * Handle an attribute that has been read by the parser. |
| 458 | * The default handling is to convert the attribute into an |
| 459 | * DOM subtree and past it in a new xmlAttr element added to |
| 460 | * the element. |
| 461 | */ |
| 462 | typedef void (*attributeSAXFunc) (void *ctx, |
| 463 | const xmlChar *name, |
| 464 | const xmlChar *value); |
| 465 | /** |
| 466 | * referenceSAXFunc: |
| 467 | * @ctx: the user data (XML parser context) |
| 468 | * @name: The entity name |
| 469 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 470 | * Called when an entity reference is detected. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 471 | */ |
| 472 | typedef void (*referenceSAXFunc) (void *ctx, |
| 473 | const xmlChar *name); |
| 474 | /** |
| 475 | * charactersSAXFunc: |
| 476 | * @ctx: the user data (XML parser context) |
| 477 | * @ch: a xmlChar string |
| 478 | * @len: the number of xmlChar |
| 479 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 480 | * Receiving some chars from the parser. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 481 | */ |
| 482 | typedef void (*charactersSAXFunc) (void *ctx, |
| 483 | const xmlChar *ch, |
| 484 | int len); |
| 485 | /** |
| 486 | * ignorableWhitespaceSAXFunc: |
| 487 | * @ctx: the user data (XML parser context) |
| 488 | * @ch: a xmlChar string |
| 489 | * @len: the number of xmlChar |
| 490 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 491 | * Receiving some ignorable whitespaces from the parser. |
| 492 | * UNUSED: by default the DOM building will use characters. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 493 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 494 | typedef void (*ignorableWhitespaceSAXFunc) (void *ctx, |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 495 | const xmlChar *ch, |
| 496 | int len); |
| 497 | /** |
| 498 | * processingInstructionSAXFunc: |
| 499 | * @ctx: the user data (XML parser context) |
| 500 | * @target: the target name |
| 501 | * @data: the PI data's |
| 502 | * |
| 503 | * A processing instruction has been parsed. |
| 504 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 505 | typedef void (*processingInstructionSAXFunc) (void *ctx, |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 506 | const xmlChar *target, |
| 507 | const xmlChar *data); |
| 508 | /** |
| 509 | * commentSAXFunc: |
| 510 | * @ctx: the user data (XML parser context) |
| 511 | * @value: the comment content |
| 512 | * |
| 513 | * A comment has been parsed. |
| 514 | */ |
| 515 | typedef void (*commentSAXFunc) (void *ctx, |
| 516 | const xmlChar *value); |
| 517 | /** |
| 518 | * cdataBlockSAXFunc: |
| 519 | * @ctx: the user data (XML parser context) |
| 520 | * @value: The pcdata content |
| 521 | * @len: the block length |
| 522 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 523 | * Called when a pcdata block has been parsed. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 524 | */ |
| 525 | typedef void (*cdataBlockSAXFunc) ( |
| 526 | void *ctx, |
| 527 | const xmlChar *value, |
| 528 | int len); |
| 529 | /** |
| 530 | * warningSAXFunc: |
| 531 | * @ctx: an XML parser context |
| 532 | * @msg: the message to display/transmit |
| 533 | * @...: extra parameters for the message display |
| 534 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 535 | * Display and format a warning messages, callback. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 536 | */ |
| 537 | typedef void (*warningSAXFunc) (void *ctx, |
| 538 | const char *msg, ...); |
| 539 | /** |
| 540 | * errorSAXFunc: |
| 541 | * @ctx: an XML parser context |
| 542 | * @msg: the message to display/transmit |
| 543 | * @...: extra parameters for the message display |
| 544 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 545 | * Display and format an error messages, callback. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 546 | */ |
| 547 | typedef void (*errorSAXFunc) (void *ctx, |
| 548 | const char *msg, ...); |
| 549 | /** |
| 550 | * fatalErrorSAXFunc: |
| 551 | * @ctx: an XML parser context |
| 552 | * @msg: the message to display/transmit |
| 553 | * @...: extra parameters for the message display |
| 554 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 555 | * Display and format fatal error messages, callback. |
Daniel Veillard | 0821b15 | 2002-11-12 20:57:47 +0000 | [diff] [blame] | 556 | * Note: so far fatalError() SAX callbacks are not used, error() |
| 557 | * get all the callbacks for errors. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 558 | */ |
| 559 | typedef void (*fatalErrorSAXFunc) (void *ctx, |
| 560 | const char *msg, ...); |
| 561 | /** |
| 562 | * isStandaloneSAXFunc: |
| 563 | * @ctx: the user data (XML parser context) |
| 564 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 565 | * Is this document tagged standalone? |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 566 | * |
| 567 | * Returns 1 if true |
| 568 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 569 | typedef int (*isStandaloneSAXFunc) (void *ctx); |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 570 | /** |
| 571 | * hasInternalSubsetSAXFunc: |
| 572 | * @ctx: the user data (XML parser context) |
| 573 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 574 | * Does this document has an internal subset. |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 575 | * |
| 576 | * Returns 1 if true |
| 577 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 578 | typedef int (*hasInternalSubsetSAXFunc) (void *ctx); |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 579 | |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 580 | /** |
| 581 | * hasExternalSubsetSAXFunc: |
| 582 | * @ctx: the user data (XML parser context) |
| 583 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 584 | * Does this document has an external subset? |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 585 | * |
| 586 | * Returns 1 if true |
| 587 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 588 | typedef int (*hasExternalSubsetSAXFunc) (void *ctx); |
| 589 | |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 590 | /************************************************************************ |
| 591 | * * |
| 592 | * The SAX version 2 API extensions * |
| 593 | * * |
| 594 | ************************************************************************/ |
| 595 | /** |
| 596 | * XML_SAX2_MAGIC: |
| 597 | * |
| 598 | * Special constant found in SAX2 blocks initialized fields |
| 599 | */ |
| 600 | #define XML_SAX2_MAGIC 0xDEEDBEAF |
| 601 | |
| 602 | /** |
| 603 | * startElementNsSAX2Func: |
| 604 | * @ctx: the user data (XML parser context) |
| 605 | * @localname: the local name of the element |
| 606 | * @prefix: the element namespace prefix if available |
| 607 | * @URI: the element namespace name if available |
| 608 | * @nb_namespaces: number of namespace definitions on that node |
| 609 | * @namespaces: pointer to the array of prefix/URI pairs namespace definitions |
| 610 | * @nb_attributes: the number of attributes on that node |
| 611 | * |
| 612 | * SAX2 callback when an element start has been detected by the parser. |
| 613 | * It provides the namespace informations for the element, as well as |
| 614 | * the new namespace declarations on the element. |
| 615 | * The number of attributes is given in this callback but the attributes |
| 616 | * themselves will be provided as separate callbacks. |
| 617 | */ |
| 618 | |
| 619 | typedef void (*startElementNsSAX2Func) (void *ctx, |
| 620 | const xmlChar *localname, |
| 621 | const xmlChar *prefix, |
| 622 | const xmlChar *URI, |
| 623 | int nb_namespaces, |
| 624 | const xmlChar **namespaces, |
| 625 | int nb_attributes); |
| 626 | |
| 627 | /** |
| 628 | * endElementNsSAX2Func: |
| 629 | * @ctx: the user data (XML parser context) |
| 630 | * @localname: the local name of the element |
| 631 | * @prefix: the element namespace prefix if available |
| 632 | * @URI: the element namespace name if available |
| 633 | * |
| 634 | * SAX2 callback when an element end has been detected by the parser. |
| 635 | * It provides the namespace informations for the element. |
| 636 | */ |
| 637 | |
| 638 | typedef void (*endElementNsSAX2Func) (void *ctx, |
| 639 | const xmlChar *localname, |
| 640 | const xmlChar *prefix, |
| 641 | const xmlChar *URI); |
| 642 | |
| 643 | /** |
| 644 | * attributeNsSAX2Func: |
| 645 | * @ctx: the user data (XML parser context) |
| 646 | * @localname: the local name of the attribute |
| 647 | * @prefix: the attribute namespace prefix if available |
| 648 | * @URI: the attribute namespace name if available |
| 649 | * @value: pointer to the attribute value string |
| 650 | * @valuelen: lenght of the attribute value string in bytes |
| 651 | * |
| 652 | * SAX2 callback when an attribute has been detected by the parser. |
| 653 | * It provides the namespace informations for the attribute, as well as |
| 654 | * the value of the attribute (note that @value may not be zero terminated |
| 655 | * and use of the @valuelen is needed to find the value end). |
| 656 | */ |
| 657 | typedef void (*attributeNsSAX2Func) (void *ctx, |
| 658 | const xmlChar *localname, |
| 659 | const xmlChar *prefix, |
| 660 | const xmlChar *URI, |
| 661 | const xmlChar *value, |
| 662 | int valuelen); |
| 663 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 664 | struct _xmlSAXHandler { |
| 665 | internalSubsetSAXFunc internalSubset; |
| 666 | isStandaloneSAXFunc isStandalone; |
| 667 | hasInternalSubsetSAXFunc hasInternalSubset; |
| 668 | hasExternalSubsetSAXFunc hasExternalSubset; |
| 669 | resolveEntitySAXFunc resolveEntity; |
| 670 | getEntitySAXFunc getEntity; |
| 671 | entityDeclSAXFunc entityDecl; |
| 672 | notationDeclSAXFunc notationDecl; |
| 673 | attributeDeclSAXFunc attributeDecl; |
| 674 | elementDeclSAXFunc elementDecl; |
| 675 | unparsedEntityDeclSAXFunc unparsedEntityDecl; |
| 676 | setDocumentLocatorSAXFunc setDocumentLocator; |
| 677 | startDocumentSAXFunc startDocument; |
| 678 | endDocumentSAXFunc endDocument; |
| 679 | startElementSAXFunc startElement; |
| 680 | endElementSAXFunc endElement; |
| 681 | referenceSAXFunc reference; |
| 682 | charactersSAXFunc characters; |
| 683 | ignorableWhitespaceSAXFunc ignorableWhitespace; |
| 684 | processingInstructionSAXFunc processingInstruction; |
| 685 | commentSAXFunc comment; |
| 686 | warningSAXFunc warning; |
| 687 | errorSAXFunc error; |
Daniel Veillard | 0821b15 | 2002-11-12 20:57:47 +0000 | [diff] [blame] | 688 | fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 689 | getParameterEntitySAXFunc getParameterEntity; |
| 690 | cdataBlockSAXFunc cdataBlock; |
| 691 | externalSubsetSAXFunc externalSubset; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 692 | int initialized; |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 693 | /* The following fields are extensions available only on version 2 */ |
| 694 | void *_private; |
| 695 | startElementNsSAX2Func startElementNs; |
| 696 | endElementNsSAX2Func endElementNs; |
| 697 | attributeNsSAX2Func attributeNs; |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 698 | }; |
| 699 | |
| 700 | /** |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 701 | * xmlExternalEntityLoader: |
| 702 | * @URL: The System ID of the resource requested |
| 703 | * @ID: The Public ID of the resource requested |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 704 | * @context: the XML parser context |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 705 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 706 | * External entity loaders types. |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 707 | * |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 708 | * Returns the entity input parser. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 709 | */ |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 710 | typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL, |
| 711 | const char *ID, |
| 712 | xmlParserCtxtPtr context); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 713 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 714 | /* |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 715 | * Global variables: just the default SAX interface tables and XML |
| 716 | * version infos. |
| 717 | */ |
Daniel Veillard | 0ba5923 | 2002-02-10 13:20:39 +0000 | [diff] [blame] | 718 | #if 0 |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 719 | LIBXML_DLL_IMPORT extern const char *xmlParserVersion; |
Daniel Veillard | 0ba5923 | 2002-02-10 13:20:39 +0000 | [diff] [blame] | 720 | #endif |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 721 | |
Daniel Veillard | 0ba5923 | 2002-02-10 13:20:39 +0000 | [diff] [blame] | 722 | /* |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 723 | LIBXML_DLL_IMPORT extern xmlSAXLocator xmlDefaultSAXLocator; |
| 724 | LIBXML_DLL_IMPORT extern xmlSAXHandler xmlDefaultSAXHandler; |
| 725 | LIBXML_DLL_IMPORT extern xmlSAXHandler htmlDefaultSAXHandler; |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 726 | LIBXML_DLL_IMPORT extern xmlSAXHandler docbDefaultSAXHandler; |
Daniel Veillard | 0ba5923 | 2002-02-10 13:20:39 +0000 | [diff] [blame] | 727 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 728 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 729 | /* |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 730 | * Entity substitution default behavior. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 731 | */ |
| 732 | |
Daniel Veillard | 0ba5923 | 2002-02-10 13:20:39 +0000 | [diff] [blame] | 733 | #if 0 |
| 734 | LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultValue; |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 735 | LIBXML_DLL_IMPORT extern int xmlGetWarningsDefaultValue; |
Daniel Veillard | 0ba5923 | 2002-02-10 13:20:39 +0000 | [diff] [blame] | 736 | #endif |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 737 | |
Daniel Veillard | 6c4ffaf | 2002-02-11 08:54:05 +0000 | [diff] [blame] | 738 | #ifdef __cplusplus |
| 739 | } |
| 740 | #endif |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 741 | |
Daniel Veillard | 6c4ffaf | 2002-02-11 08:54:05 +0000 | [diff] [blame] | 742 | #include <libxml/encoding.h> |
| 743 | #include <libxml/xmlIO.h> |
| 744 | #include <libxml/globals.h> |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 745 | |
Daniel Veillard | 6c4ffaf | 2002-02-11 08:54:05 +0000 | [diff] [blame] | 746 | #ifdef __cplusplus |
| 747 | extern "C" { |
| 748 | #endif |
| 749 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 750 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 751 | /* |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 752 | * Init/Cleanup |
| 753 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 754 | XMLPUBFUN void XMLCALL |
| 755 | xmlInitParser (void); |
| 756 | XMLPUBFUN void XMLCALL |
| 757 | xmlCleanupParser (void); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 758 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 759 | /* |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 760 | * Input functions |
| 761 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 762 | XMLPUBFUN int XMLCALL |
| 763 | xmlParserInputRead (xmlParserInputPtr in, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 764 | int len); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 765 | XMLPUBFUN int XMLCALL |
| 766 | xmlParserInputGrow (xmlParserInputPtr in, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 767 | int len); |
| 768 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 769 | /* |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 770 | * xmlChar handling |
| 771 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 772 | XMLPUBFUN xmlChar * XMLCALL |
| 773 | xmlStrdup (const xmlChar *cur); |
| 774 | XMLPUBFUN xmlChar * XMLCALL |
| 775 | xmlStrndup (const xmlChar *cur, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 776 | int len); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 777 | XMLPUBFUN xmlChar * XMLCALL |
| 778 | xmlCharStrndup (const char *cur, |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame] | 779 | int len); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 780 | XMLPUBFUN xmlChar * XMLCALL |
| 781 | xmlCharStrdup (const char *cur); |
| 782 | XMLPUBFUN xmlChar * XMLCALL |
| 783 | xmlStrsub (const xmlChar *str, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 784 | int start, |
| 785 | int len); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 786 | XMLPUBFUN const xmlChar * XMLCALL |
| 787 | xmlStrchr (const xmlChar *str, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 788 | xmlChar val); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 789 | XMLPUBFUN const xmlChar * XMLCALL |
| 790 | xmlStrstr (const xmlChar *str, |
Daniel Veillard | 7704473 | 2001-06-29 21:31:07 +0000 | [diff] [blame] | 791 | const xmlChar *val); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 792 | XMLPUBFUN const xmlChar * XMLCALL |
| 793 | xmlStrcasestr (const xmlChar *str, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 794 | xmlChar *val); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 795 | XMLPUBFUN int XMLCALL |
| 796 | xmlStrcmp (const xmlChar *str1, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 797 | const xmlChar *str2); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 798 | XMLPUBFUN int XMLCALL |
| 799 | xmlStrncmp (const xmlChar *str1, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 800 | const xmlChar *str2, |
| 801 | int len); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 802 | XMLPUBFUN int XMLCALL |
| 803 | xmlStrcasecmp (const xmlChar *str1, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 804 | const xmlChar *str2); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 805 | XMLPUBFUN int XMLCALL |
| 806 | xmlStrncasecmp (const xmlChar *str1, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 807 | const xmlChar *str2, |
| 808 | int len); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 809 | XMLPUBFUN int XMLCALL |
| 810 | xmlStrEqual (const xmlChar *str1, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 811 | const xmlChar *str2); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 812 | XMLPUBFUN int XMLCALL |
| 813 | xmlStrlen (const xmlChar *str); |
| 814 | XMLPUBFUN xmlChar * XMLCALL |
| 815 | xmlStrcat (xmlChar *cur, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 816 | const xmlChar *add); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 817 | XMLPUBFUN xmlChar * XMLCALL |
| 818 | xmlStrncat (xmlChar *cur, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 819 | const xmlChar *add, |
| 820 | int len); |
| 821 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 822 | /* |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 823 | * Basic parsing Interfaces |
| 824 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 825 | XMLPUBFUN xmlDocPtr XMLCALL |
| 826 | xmlParseDoc (xmlChar *cur); |
| 827 | XMLPUBFUN xmlDocPtr XMLCALL |
| 828 | xmlParseMemory (const char *buffer, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 829 | int size); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 830 | XMLPUBFUN xmlDocPtr XMLCALL |
| 831 | xmlParseFile (const char *filename); |
| 832 | XMLPUBFUN int XMLCALL |
| 833 | xmlSubstituteEntitiesDefault(int val); |
| 834 | XMLPUBFUN int XMLCALL |
| 835 | xmlKeepBlanksDefault (int val); |
| 836 | XMLPUBFUN void XMLCALL |
| 837 | xmlStopParser (xmlParserCtxtPtr ctxt); |
| 838 | XMLPUBFUN int XMLCALL |
| 839 | xmlPedanticParserDefault(int val); |
| 840 | XMLPUBFUN int XMLCALL |
| 841 | xmlLineNumbersDefault (int val); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 842 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 843 | /* |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 844 | * Recovery mode |
| 845 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 846 | XMLPUBFUN xmlDocPtr XMLCALL |
| 847 | xmlRecoverDoc (xmlChar *cur); |
| 848 | XMLPUBFUN xmlDocPtr XMLCALL |
| 849 | xmlRecoverMemory (const char *buffer, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 850 | int size); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 851 | XMLPUBFUN xmlDocPtr XMLCALL |
| 852 | xmlRecoverFile (const char *filename); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 853 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 854 | /* |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 855 | * Less common routines and SAX interfaces |
| 856 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 857 | XMLPUBFUN int XMLCALL |
| 858 | xmlParseDocument (xmlParserCtxtPtr ctxt); |
| 859 | XMLPUBFUN int XMLCALL |
| 860 | xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt); |
| 861 | XMLPUBFUN xmlDocPtr XMLCALL |
| 862 | xmlSAXParseDoc (xmlSAXHandlerPtr sax, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 863 | xmlChar *cur, |
| 864 | int recovery); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 865 | XMLPUBFUN int XMLCALL |
| 866 | xmlSAXUserParseFile (xmlSAXHandlerPtr sax, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 867 | void *user_data, |
| 868 | const char *filename); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 869 | XMLPUBFUN int XMLCALL |
| 870 | xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 871 | void *user_data, |
Daniel Veillard | fd7ddca | 2001-05-16 10:57:35 +0000 | [diff] [blame] | 872 | const char *buffer, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 873 | int size); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 874 | XMLPUBFUN xmlDocPtr XMLCALL |
| 875 | xmlSAXParseMemory (xmlSAXHandlerPtr sax, |
Daniel Veillard | 50822cb | 2001-07-26 20:05:51 +0000 | [diff] [blame] | 876 | const char *buffer, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 877 | int size, |
| 878 | int recovery); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 879 | XMLPUBFUN xmlDocPtr XMLCALL |
| 880 | xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, |
Daniel Veillard | 8606bbb | 2002-11-12 12:36:52 +0000 | [diff] [blame] | 881 | const char *buffer, |
| 882 | int size, |
| 883 | int recovery, |
| 884 | void *data); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 885 | XMLPUBFUN xmlDocPtr XMLCALL |
| 886 | xmlSAXParseFile (xmlSAXHandlerPtr sax, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 887 | const char *filename, |
| 888 | int recovery); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 889 | XMLPUBFUN xmlDocPtr XMLCALL |
| 890 | xmlSAXParseFileWithData (xmlSAXHandlerPtr sax, |
Daniel Veillard | a293c32 | 2001-10-02 13:54:14 +0000 | [diff] [blame] | 891 | const char *filename, |
| 892 | int recovery, |
| 893 | void *data); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 894 | XMLPUBFUN xmlDocPtr XMLCALL |
| 895 | xmlSAXParseEntity (xmlSAXHandlerPtr sax, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 896 | const char *filename); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 897 | XMLPUBFUN xmlDocPtr XMLCALL |
| 898 | xmlParseEntity (const char *filename); |
| 899 | XMLPUBFUN xmlDtdPtr XMLCALL |
| 900 | xmlParseDTD (const xmlChar *ExternalID, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 901 | const xmlChar *SystemID); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 902 | XMLPUBFUN xmlDtdPtr XMLCALL |
| 903 | xmlSAXParseDTD (xmlSAXHandlerPtr sax, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 904 | const xmlChar *ExternalID, |
| 905 | const xmlChar *SystemID); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 906 | XMLPUBFUN xmlDtdPtr XMLCALL |
| 907 | xmlIOParseDTD (xmlSAXHandlerPtr sax, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 908 | xmlParserInputBufferPtr input, |
| 909 | xmlCharEncoding enc); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 910 | XMLPUBFUN int XMLCALL |
| 911 | xmlParseBalancedChunkMemory(xmlDocPtr doc, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 912 | xmlSAXHandlerPtr sax, |
| 913 | void *user_data, |
| 914 | int depth, |
| 915 | const xmlChar *string, |
Daniel Veillard | cda9692 | 2001-08-21 10:56:31 +0000 | [diff] [blame] | 916 | xmlNodePtr *lst); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 917 | XMLPUBFUN int XMLCALL |
| 918 | xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, |
Daniel Veillard | 58e44c9 | 2002-08-02 22:19:49 +0000 | [diff] [blame] | 919 | xmlSAXHandlerPtr sax, |
| 920 | void *user_data, |
| 921 | int depth, |
| 922 | const xmlChar *string, |
| 923 | xmlNodePtr *lst, |
| 924 | int recover); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 925 | XMLPUBFUN int XMLCALL |
| 926 | xmlParseExternalEntity (xmlDocPtr doc, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 927 | xmlSAXHandlerPtr sax, |
| 928 | void *user_data, |
| 929 | int depth, |
| 930 | const xmlChar *URL, |
| 931 | const xmlChar *ID, |
Daniel Veillard | cda9692 | 2001-08-21 10:56:31 +0000 | [diff] [blame] | 932 | xmlNodePtr *lst); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 933 | XMLPUBFUN int XMLCALL |
| 934 | xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 935 | const xmlChar *URL, |
| 936 | const xmlChar *ID, |
Daniel Veillard | cda9692 | 2001-08-21 10:56:31 +0000 | [diff] [blame] | 937 | xmlNodePtr *lst); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 938 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 939 | /* |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 940 | * Parser contexts handling. |
| 941 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 942 | XMLPUBFUN int XMLCALL |
| 943 | xmlInitParserCtxt (xmlParserCtxtPtr ctxt); |
| 944 | XMLPUBFUN void XMLCALL |
| 945 | xmlClearParserCtxt (xmlParserCtxtPtr ctxt); |
| 946 | XMLPUBFUN void XMLCALL |
| 947 | xmlFreeParserCtxt (xmlParserCtxtPtr ctxt); |
| 948 | XMLPUBFUN void XMLCALL |
| 949 | xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 950 | const xmlChar* buffer, |
Daniel Veillard | 963d2ae | 2002-01-20 22:08:18 +0000 | [diff] [blame] | 951 | const char *filename); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 952 | XMLPUBFUN xmlParserCtxtPtr XMLCALL |
| 953 | xmlCreateDocParserCtxt (xmlChar *cur); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 954 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 955 | /* |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 956 | * Reading/setting optional parsing features. |
| 957 | */ |
| 958 | |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 959 | XMLPUBFUN int XMLCALL |
| 960 | xmlGetFeaturesList (int *len, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 961 | const char **result); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 962 | XMLPUBFUN int XMLCALL |
| 963 | xmlGetFeature (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 964 | const char *name, |
| 965 | void *result); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 966 | XMLPUBFUN int XMLCALL |
| 967 | xmlSetFeature (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 968 | const char *name, |
| 969 | void *value); |
| 970 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 971 | /* |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 972 | * Interfaces for the Push mode. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 973 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 974 | XMLPUBFUN xmlParserCtxtPtr XMLCALL |
| 975 | xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 976 | void *user_data, |
| 977 | const char *chunk, |
| 978 | int size, |
| 979 | const char *filename); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 980 | XMLPUBFUN int XMLCALL |
| 981 | xmlParseChunk (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 982 | const char *chunk, |
| 983 | int size, |
| 984 | int terminate); |
| 985 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 986 | /* |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 987 | * Special I/O mode. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 988 | */ |
| 989 | |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 990 | XMLPUBFUN xmlParserCtxtPtr XMLCALL |
| 991 | xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 992 | void *user_data, |
| 993 | xmlInputReadCallback ioread, |
| 994 | xmlInputCloseCallback ioclose, |
| 995 | void *ioctx, |
| 996 | xmlCharEncoding enc); |
| 997 | |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 998 | XMLPUBFUN xmlParserInputPtr XMLCALL |
| 999 | xmlNewIOInputStream (xmlParserCtxtPtr ctxt, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1000 | xmlParserInputBufferPtr input, |
| 1001 | xmlCharEncoding enc); |
| 1002 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 1003 | /* |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 1004 | * Node infos. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1005 | */ |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 1006 | XMLPUBFUN const xmlParserNodeInfo* XMLCALL |
Daniel Veillard | 963d2ae | 2002-01-20 22:08:18 +0000 | [diff] [blame] | 1007 | xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt, |
| 1008 | const xmlNodePtr node); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 1009 | XMLPUBFUN void XMLCALL |
| 1010 | xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); |
| 1011 | XMLPUBFUN void XMLCALL |
| 1012 | xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); |
| 1013 | XMLPUBFUN unsigned long XMLCALL |
| 1014 | xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq, |
Daniel Veillard | 963d2ae | 2002-01-20 22:08:18 +0000 | [diff] [blame] | 1015 | const xmlNodePtr node); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 1016 | XMLPUBFUN void XMLCALL |
| 1017 | xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt, |
Daniel Veillard | 963d2ae | 2002-01-20 22:08:18 +0000 | [diff] [blame] | 1018 | const xmlParserNodeInfoPtr info); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1019 | |
| 1020 | /* |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 1021 | * External entities handling actually implemented in xmlIO. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1022 | */ |
| 1023 | |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 1024 | XMLPUBFUN void XMLCALL |
| 1025 | xmlSetExternalEntityLoader(xmlExternalEntityLoader f); |
| 1026 | XMLPUBFUN xmlExternalEntityLoader XMLCALL |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1027 | xmlGetExternalEntityLoader(void); |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 1028 | XMLPUBFUN xmlParserInputPtr XMLCALL |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1029 | xmlLoadExternalEntity (const char *URL, |
| 1030 | const char *ID, |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 1031 | xmlParserCtxtPtr ctxt); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1032 | |
| 1033 | #ifdef __cplusplus |
| 1034 | } |
| 1035 | #endif |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1036 | #endif /* __XML_PARSER_H__ */ |
| 1037 | |