blob: 51797fddd7ded64848b94235fa01268fdac7fdd6 [file] [log] [blame]
Daniel Veillard260a68f1998-08-13 03:39:55 +00001/*
Daniel Veillardb05deb71999-08-10 19:04:08 +00002 * parser.h : Interfaces, constants and types related to the XML parser.
Daniel Veillard260a68f1998-08-13 03:39:55 +00003 *
4 * See Copyright for the status of this software.
5 *
Daniel Veillard39a1f9a1999-01-17 19:11:59 +00006 * Daniel.Veillard@w3.org
Daniel Veillard260a68f1998-08-13 03:39:55 +00007 */
8
9#ifndef __XML_PARSER_H__
10#define __XML_PARSER_H__
11
12#include "tree.h"
Daniel Veillardb05deb71999-08-10 19:04:08 +000013#include "valid.h"
Daniel Veillard14fff061999-06-22 21:49:07 +000014#include "xmlIO.h"
Daniel Veillard260a68f1998-08-13 03:39:55 +000015
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20/*
21 * Constants.
22 */
23#define XML_DEFAULT_VERSION "1.0"
24
Daniel Veillardb05deb71999-08-10 19:04:08 +000025/**
26 * an xmlParserInput is an input flow for the XML processor.
27 * Each entity parsed is associated an xmlParserInput (except the
28 * few predefined ones). This is the case both for internal entities
29 * - in which case the flow is already completely in memory - or
30 * external entities - in which case we use the buf structure for
31 * progressive reading and I18N conversions to the internal UTF-8 format.
32 */
33
Daniel Veillarddd6b3671999-09-23 22:19:22 +000034typedef void (* xmlParserInputDeallocate)(xmlChar *);
Daniel Veillard260a68f1998-08-13 03:39:55 +000035typedef struct xmlParserInput {
Daniel Veillard14fff061999-06-22 21:49:07 +000036 /* Input buffer */
37 xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
38
Daniel Veillard260a68f1998-08-13 03:39:55 +000039 const char *filename; /* The file analyzed, if any */
Daniel Veillardb05deb71999-08-10 19:04:08 +000040 const char *directory; /* the directory/base of teh file */
Daniel Veillarddd6b3671999-09-23 22:19:22 +000041 const xmlChar *base; /* Base of the array to parse */
42 const xmlChar *cur; /* Current char being parsed */
Daniel Veillard260a68f1998-08-13 03:39:55 +000043 int line; /* Current line */
44 int col; /* Current column */
Daniel Veillarddd6b3671999-09-23 22:19:22 +000045 int consumed; /* How many xmlChars were already consumed */
Daniel Veillardd692aa41999-02-28 21:54:31 +000046 xmlParserInputDeallocate free; /* function to deallocate the base */
Daniel Veillard1e346af1999-02-22 10:33:01 +000047} xmlParserInput;
48typedef xmlParserInput *xmlParserInputPtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +000049
Daniel Veillardb96e6431999-08-29 21:02:19 +000050typedef xmlParserInputPtr (*xmlExternalEntityLoader)(const char *URL,
51 const char *ID,
52 xmlParserInputPtr context);
53
Daniel Veillardb05deb71999-08-10 19:04:08 +000054/**
55 * the parser can be asked to collect Node informations, i.e. at what
56 * place in the file they were detected.
57 * NOTE: This is off by default and not very well tested.
58 */
Daniel Veillard1e346af1999-02-22 10:33:01 +000059typedef struct _xmlParserNodeInfo {
Daniel Veillard260a68f1998-08-13 03:39:55 +000060 const struct xmlNode* node;
61 /* Position & line # that text that created the node begins & ends on */
62 unsigned long begin_pos;
63 unsigned long begin_line;
64 unsigned long end_pos;
65 unsigned long end_line;
Daniel Veillard1e346af1999-02-22 10:33:01 +000066} _xmlParserNodeInfo;
67typedef _xmlParserNodeInfo xmlParserNodeInfo;
Daniel Veillard260a68f1998-08-13 03:39:55 +000068
69typedef struct xmlParserNodeInfoSeq {
70 unsigned long maximum;
71 unsigned long length;
72 xmlParserNodeInfo* buffer;
Daniel Veillard1e346af1999-02-22 10:33:01 +000073} _xmlParserNodeInfoSeq;
74typedef _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
75typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +000076
Daniel Veillardb05deb71999-08-10 19:04:08 +000077/**
78 * The parser is not a state based parser, but we need to maintain
79 * minimum state informations, especially for entities processing.
80 */
Daniel Veillard00fdf371999-10-08 09:40:39 +000081typedef enum {
Daniel Veillardb05deb71999-08-10 19:04:08 +000082 XML_PARSER_EOF = 0,
83 XML_PARSER_PROLOG,
84 XML_PARSER_CONTENT,
85 XML_PARSER_ENTITY_DECL,
86 XML_PARSER_ENTITY_VALUE,
87 XML_PARSER_ATTRIBUTE_VALUE,
88 XML_PARSER_DTD,
89 XML_PARSER_EPILOG,
90 XML_PARSER_COMMENT,
Daniel Veillardb96e6431999-08-29 21:02:19 +000091 XML_PARSER_CDATA_SECTION
Daniel Veillardb05deb71999-08-10 19:04:08 +000092} xmlParserInputState;
93
94/**
95 * The parser context.
96 * NOTE This doesn't completely defines the parser state, the (current ?)
97 * design of the parser uses recursive function calls since this allow
98 * and easy mapping from the production rules of the specification
99 * to the actual code. The drawback is that the actual function call
100 * also reflect the parser state. However most of the parsing routines
101 * takes as the only argument the parser context pointer, so migrating
102 * to a state based parser for progressive parsing shouldn't be too hard.
103 */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000104typedef struct _xmlParserCtxt {
Daniel Veillard260a68f1998-08-13 03:39:55 +0000105 struct xmlSAXHandler *sax; /* The SAX handler */
Daniel Veillard517752b1999-04-05 12:20:10 +0000106 void *userData; /* the document being built */
107 xmlDocPtr myDoc; /* the document being built */
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000108 int wellFormed; /* is the document well formed */
Daniel Veillard011b63c1999-06-02 17:44:04 +0000109 int replaceEntities; /* shall we replace entities ? */
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000110 const xmlChar *version; /* the XML version string */
111 const xmlChar *encoding; /* encoding, if any */
Daniel Veillardb05deb71999-08-10 19:04:08 +0000112 int standalone; /* standalone document */
Daniel Veillardb05deb71999-08-10 19:04:08 +0000113 int html; /* are we parsing an HTML document */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000114
115 /* Input stream stack */
116 xmlParserInputPtr input; /* Current input stream */
117 int inputNr; /* Number of current input streams */
118 int inputMax; /* Max number of input streams */
119 xmlParserInputPtr *inputTab; /* stack of inputs */
120
Daniel Veillardb05deb71999-08-10 19:04:08 +0000121 /* Node analysis stack only used for DOM building */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000122 xmlNodePtr node; /* Current parsed Node */
123 int nodeNr; /* Depth of the parsing stack */
124 int nodeMax; /* Max depth of the parsing stack */
125 xmlNodePtr *nodeTab; /* array of nodes */
126
127 int record_info; /* Whether node info should be kept */
128 xmlParserNodeInfoSeq node_seq; /* info about each node parsed */
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000129
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000130 int errNo; /* error code */
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000131
132 int hasExternalSubset; /* reference and external subset */
133 int hasPErefs; /* the internal subset has PE refs */
134 int external; /* are we parsing an external entity */
135
136 int valid; /* is the document valid */
137 int validate; /* shall we try to validate ? */
138 xmlValidCtxt vctxt; /* The validity context */
139
140 xmlParserInputState instate; /* current type of input */
141 int token; /* next char look-ahead */
142
143 char *directory; /* the data directory */
Daniel Veillard2673d3c1999-10-08 14:37:09 +0000144
145 /* Node name stack only used for HTML parsing */
146 xmlChar *name; /* Current parsed Node */
147 int nameNr; /* Depth of the parsing stack */
148 int nameMax; /* Max depth of the parsing stack */
149 xmlChar * *nameTab; /* array of nodes */
150
Daniel Veillard1e346af1999-02-22 10:33:01 +0000151} _xmlParserCtxt;
152typedef _xmlParserCtxt xmlParserCtxt;
153typedef xmlParserCtxt *xmlParserCtxtPtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000154
Daniel Veillardb05deb71999-08-10 19:04:08 +0000155/**
Daniel Veillard260a68f1998-08-13 03:39:55 +0000156 * a SAX Locator.
157 */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000158typedef struct xmlSAXLocator {
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000159 const xmlChar *(*getPublicId)(void *ctx);
160 const xmlChar *(*getSystemId)(void *ctx);
Daniel Veillard27d88741999-05-29 11:51:49 +0000161 int (*getLineNumber)(void *ctx);
162 int (*getColumnNumber)(void *ctx);
Daniel Veillard1e346af1999-02-22 10:33:01 +0000163} _xmlSAXLocator;
164typedef _xmlSAXLocator xmlSAXLocator;
165typedef xmlSAXLocator *xmlSAXLocatorPtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000166
Daniel Veillardb05deb71999-08-10 19:04:08 +0000167/**
168 * a SAX handler is bunch of callbacks called by the parser when processing
169 * of the input generate data or structure informations.
Daniel Veillard260a68f1998-08-13 03:39:55 +0000170 */
171
Daniel Veillard517752b1999-04-05 12:20:10 +0000172#include "entities.h"
173
Daniel Veillard27d88741999-05-29 11:51:49 +0000174typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000175 const xmlChar *publicId, const xmlChar *systemId);
176typedef void (*internalSubsetSAXFunc) (void *ctx, const xmlChar *name,
177 const xmlChar *ExternalID, const xmlChar *SystemID);
Daniel Veillard27d88741999-05-29 11:51:49 +0000178typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000179 const xmlChar *name);
Daniel Veillardb05deb71999-08-10 19:04:08 +0000180typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000181 const xmlChar *name);
Daniel Veillard27d88741999-05-29 11:51:49 +0000182typedef void (*entityDeclSAXFunc) (void *ctx,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000183 const xmlChar *name, int type, const xmlChar *publicId,
184 const xmlChar *systemId, xmlChar *content);
185typedef void (*notationDeclSAXFunc)(void *ctx, const xmlChar *name,
186 const xmlChar *publicId, const xmlChar *systemId);
187typedef void (*attributeDeclSAXFunc)(void *ctx, const xmlChar *elem,
188 const xmlChar *name, int type, int def,
189 const xmlChar *defaultValue, xmlEnumerationPtr tree);
190typedef void (*elementDeclSAXFunc)(void *ctx, const xmlChar *name,
Daniel Veillard517752b1999-04-05 12:20:10 +0000191 int type, xmlElementContentPtr content);
Daniel Veillard27d88741999-05-29 11:51:49 +0000192typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000193 const xmlChar *name, const xmlChar *publicId,
194 const xmlChar *systemId, const xmlChar *notationName);
Daniel Veillard27d88741999-05-29 11:51:49 +0000195typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
Daniel Veillard260a68f1998-08-13 03:39:55 +0000196 xmlSAXLocatorPtr loc);
Daniel Veillard27d88741999-05-29 11:51:49 +0000197typedef void (*startDocumentSAXFunc) (void *ctx);
198typedef void (*endDocumentSAXFunc) (void *ctx);
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000199typedef void (*startElementSAXFunc) (void *ctx, const xmlChar *name,
200 const xmlChar **atts);
201typedef void (*endElementSAXFunc) (void *ctx, const xmlChar *name);
202typedef void (*attributeSAXFunc) (void *ctx, const xmlChar *name,
203 const xmlChar *value);
204typedef void (*referenceSAXFunc) (void *ctx, const xmlChar *name);
205typedef void (*charactersSAXFunc) (void *ctx, const xmlChar *ch,
Daniel Veillard517752b1999-04-05 12:20:10 +0000206 int len);
Daniel Veillard27d88741999-05-29 11:51:49 +0000207typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000208 const xmlChar *ch, int len);
Daniel Veillard27d88741999-05-29 11:51:49 +0000209typedef void (*processingInstructionSAXFunc) (void *ctx,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000210 const xmlChar *target, const xmlChar *data);
211typedef void (*commentSAXFunc) (void *ctx, const xmlChar *value);
212typedef void (*cdataBlockSAXFunc) (void *ctx, const xmlChar *value, int len);
Daniel Veillard27d88741999-05-29 11:51:49 +0000213typedef void (*warningSAXFunc) (void *ctx, const char *msg, ...);
214typedef void (*errorSAXFunc) (void *ctx, const char *msg, ...);
215typedef void (*fatalErrorSAXFunc) (void *ctx, const char *msg, ...);
216typedef int (*isStandaloneSAXFunc) (void *ctx);
217typedef int (*hasInternalSubsetSAXFunc) (void *ctx);
218typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000219
220typedef struct xmlSAXHandler {
Daniel Veillard517752b1999-04-05 12:20:10 +0000221 internalSubsetSAXFunc internalSubset;
222 isStandaloneSAXFunc isStandalone;
223 hasInternalSubsetSAXFunc hasInternalSubset;
224 hasExternalSubsetSAXFunc hasExternalSubset;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000225 resolveEntitySAXFunc resolveEntity;
Daniel Veillard517752b1999-04-05 12:20:10 +0000226 getEntitySAXFunc getEntity;
227 entityDeclSAXFunc entityDecl;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000228 notationDeclSAXFunc notationDecl;
Daniel Veillard517752b1999-04-05 12:20:10 +0000229 attributeDeclSAXFunc attributeDecl;
230 elementDeclSAXFunc elementDecl;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000231 unparsedEntityDeclSAXFunc unparsedEntityDecl;
232 setDocumentLocatorSAXFunc setDocumentLocator;
233 startDocumentSAXFunc startDocument;
234 endDocumentSAXFunc endDocument;
235 startElementSAXFunc startElement;
236 endElementSAXFunc endElement;
Daniel Veillard517752b1999-04-05 12:20:10 +0000237 referenceSAXFunc reference;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000238 charactersSAXFunc characters;
239 ignorableWhitespaceSAXFunc ignorableWhitespace;
240 processingInstructionSAXFunc processingInstruction;
Daniel Veillard517752b1999-04-05 12:20:10 +0000241 commentSAXFunc comment;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000242 warningSAXFunc warning;
243 errorSAXFunc error;
244 fatalErrorSAXFunc fatalError;
Daniel Veillardb05deb71999-08-10 19:04:08 +0000245 getParameterEntitySAXFunc getParameterEntity;
246 cdataBlockSAXFunc cdataBlock;
Daniel Veillard1e346af1999-02-22 10:33:01 +0000247} xmlSAXHandler;
248typedef xmlSAXHandler *xmlSAXHandlerPtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000249
Daniel Veillardb05deb71999-08-10 19:04:08 +0000250/**
Daniel Veillard6454aec1999-09-02 22:04:43 +0000251 * Global variables: just the default SAX interface tables and XML
252 * version infos.
Daniel Veillard260a68f1998-08-13 03:39:55 +0000253 */
Daniel Veillard14fff061999-06-22 21:49:07 +0000254extern const char *xmlParserVersion;
255
Daniel Veillard151b1b01998-09-23 00:49:46 +0000256extern xmlSAXLocator xmlDefaultSAXLocator;
257extern xmlSAXHandler xmlDefaultSAXHandler;
Daniel Veillardbe70ff71999-07-05 16:50:46 +0000258extern xmlSAXHandler htmlDefaultSAXHandler;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000259
Daniel Veillard6454aec1999-09-02 22:04:43 +0000260/**
261 * entity substitution default behaviour.
262 */
263
264extern int xmlSubstituteEntitiesDefaultValue;
265
266
Daniel Veillardccb09631998-10-27 06:21:04 +0000267#include "entities.h"
Daniel Veillardd109e371999-03-05 06:26:45 +0000268#include "xml-error.h"
Daniel Veillardccb09631998-10-27 06:21:04 +0000269
Daniel Veillardb05deb71999-08-10 19:04:08 +0000270/**
Daniel Veillarda819dac1999-11-24 18:04:22 +0000271 * Cleanup
272 */
273void xmlCleanupParser (void);
274
275/**
Daniel Veillarde2d034d1999-07-27 19:52:06 +0000276 * Input functions
277 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000278int xmlParserInputRead (xmlParserInputPtr in,
279 int len);
280int xmlParserInputGrow (xmlParserInputPtr in,
281 int len);
Daniel Veillarde2d034d1999-07-27 19:52:06 +0000282
Daniel Veillardb05deb71999-08-10 19:04:08 +0000283/**
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000284 * xmlChar handling
Daniel Veillard260a68f1998-08-13 03:39:55 +0000285 */
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000286xmlChar * xmlStrdup (const xmlChar *cur);
287xmlChar * xmlStrndup (const xmlChar *cur,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000288 int len);
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000289xmlChar * xmlStrsub (const xmlChar *str,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000290 int start,
291 int len);
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000292const xmlChar * xmlStrchr (const xmlChar *str,
293 xmlChar val);
294const xmlChar * xmlStrstr (const xmlChar *str,
295 xmlChar *val);
296int xmlStrcmp (const xmlChar *str1,
297 const xmlChar *str2);
298int xmlStrncmp (const xmlChar *str1,
299 const xmlChar *str2,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000300 int len);
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000301int xmlStrlen (const xmlChar *str);
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000302xmlChar * xmlStrcat (xmlChar *cur,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000303 const xmlChar *add);
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000304xmlChar * xmlStrncat (xmlChar *cur,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000305 const xmlChar *add,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000306 int len);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000307
Daniel Veillardb05deb71999-08-10 19:04:08 +0000308/**
309 * Basic parsing Interfaces
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000310 */
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000311xmlDocPtr xmlParseDoc (xmlChar *cur);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000312xmlDocPtr xmlParseMemory (char *buffer,
313 int size);
314xmlDocPtr xmlParseFile (const char *filename);
315int xmlSubstituteEntitiesDefault(int val);
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000316
Daniel Veillardb05deb71999-08-10 19:04:08 +0000317/**
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000318 * Recovery mode
319 */
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000320xmlDocPtr xmlRecoverDoc (xmlChar *cur);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000321xmlDocPtr xmlRecoverMemory (char *buffer,
322 int size);
323xmlDocPtr xmlRecoverFile (const char *filename);
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000324
Daniel Veillardb05deb71999-08-10 19:04:08 +0000325/**
326 * Less common routines and SAX interfaces
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000327 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000328int xmlParseDocument (xmlParserCtxtPtr ctxt);
329xmlDocPtr xmlSAXParseDoc (xmlSAXHandlerPtr sax,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000330 xmlChar *cur,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000331 int recovery);
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000332int xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
333 void *user_data,
334 const char *filename);
335int xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
336 void *user_data,
337 char *buffer,
338 int size);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000339xmlDocPtr xmlSAXParseMemory (xmlSAXHandlerPtr sax,
340 char *buffer,
341 int size,
342 int recovery);
343xmlDocPtr xmlSAXParseFile (xmlSAXHandlerPtr sax,
344 const char *filename,
345 int recovery);
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000346xmlDtdPtr xmlParseDTD (const xmlChar *ExternalID,
347 const xmlChar *SystemID);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000348xmlDtdPtr xmlSAXParseDTD (xmlSAXHandlerPtr sax,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000349 const xmlChar *ExternalID,
350 const xmlChar *SystemID);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000351void xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
352void xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
353void xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000354 const xmlChar* buffer,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000355 const char* filename);
356void xmlDefaultSAXHandlerInit(void);
357void htmlDefaultSAXHandlerInit(void);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000358
Daniel Veillardb96e6431999-08-29 21:02:19 +0000359/**
360 * Node infos
361 */
362const xmlParserNodeInfo*
363 xmlParserFindNodeInfo (const xmlParserCtxt* ctxt,
Daniel Veillard1e346af1999-02-22 10:33:01 +0000364 const xmlNode* node);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000365void xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
366void xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000367unsigned long xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeq* seq,
368 const xmlNode* node);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000369void xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
370 const xmlParserNodeInfo* info);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000371
Daniel Veillardb96e6431999-08-29 21:02:19 +0000372/*
373 * External entities handling actually implemented in xmlIO
374 */
375
376void xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
377xmlExternalEntityLoader
378 xmlGetExternalEntityLoader(void);
379xmlParserInputPtr
380 xmlLoadExternalEntity (const char *URL,
381 const char *ID,
382 xmlParserInputPtr context);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000383#ifdef __cplusplus
384}
385#endif
386
387#endif /* __XML_PARSER_H__ */
388