blob: 9ffab607cedc3bea8713f719fdad90f251363c77 [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 Veillarde2d034d1999-07-27 19:52:06 +0000271 * Input functions
272 */
273
Daniel Veillardb96e6431999-08-29 21:02:19 +0000274int xmlParserInputRead (xmlParserInputPtr in,
275 int len);
276int xmlParserInputGrow (xmlParserInputPtr in,
277 int len);
Daniel Veillarde2d034d1999-07-27 19:52:06 +0000278
Daniel Veillardb05deb71999-08-10 19:04:08 +0000279/**
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000280 * xmlChar handling
Daniel Veillard260a68f1998-08-13 03:39:55 +0000281 */
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000282xmlChar * xmlStrdup (const xmlChar *cur);
283xmlChar * xmlStrndup (const xmlChar *cur,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000284 int len);
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000285xmlChar * xmlStrsub (const xmlChar *str,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000286 int start,
287 int len);
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000288const xmlChar * xmlStrchr (const xmlChar *str,
289 xmlChar val);
290const xmlChar * xmlStrstr (const xmlChar *str,
291 xmlChar *val);
292int xmlStrcmp (const xmlChar *str1,
293 const xmlChar *str2);
294int xmlStrncmp (const xmlChar *str1,
295 const xmlChar *str2,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000296 int len);
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000297int xmlStrlen (const xmlChar *str);
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000298xmlChar * xmlStrcat (xmlChar *cur,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000299 const xmlChar *add);
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000300xmlChar * xmlStrncat (xmlChar *cur,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000301 const xmlChar *add,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000302 int len);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000303
Daniel Veillardb05deb71999-08-10 19:04:08 +0000304/**
305 * Basic parsing Interfaces
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000306 */
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000307xmlDocPtr xmlParseDoc (xmlChar *cur);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000308xmlDocPtr xmlParseMemory (char *buffer,
309 int size);
310xmlDocPtr xmlParseFile (const char *filename);
311int xmlSubstituteEntitiesDefault(int val);
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000312
Daniel Veillardb05deb71999-08-10 19:04:08 +0000313/**
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000314 * Recovery mode
315 */
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000316xmlDocPtr xmlRecoverDoc (xmlChar *cur);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000317xmlDocPtr xmlRecoverMemory (char *buffer,
318 int size);
319xmlDocPtr xmlRecoverFile (const char *filename);
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000320
Daniel Veillardb05deb71999-08-10 19:04:08 +0000321/**
322 * Less common routines and SAX interfaces
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000323 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000324int xmlParseDocument (xmlParserCtxtPtr ctxt);
325xmlDocPtr xmlSAXParseDoc (xmlSAXHandlerPtr sax,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000326 xmlChar *cur,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000327 int recovery);
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000328int xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
329 void *user_data,
330 const char *filename);
331int xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
332 void *user_data,
333 char *buffer,
334 int size);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000335xmlDocPtr xmlSAXParseMemory (xmlSAXHandlerPtr sax,
336 char *buffer,
337 int size,
338 int recovery);
339xmlDocPtr xmlSAXParseFile (xmlSAXHandlerPtr sax,
340 const char *filename,
341 int recovery);
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000342xmlDtdPtr xmlParseDTD (const xmlChar *ExternalID,
343 const xmlChar *SystemID);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000344xmlDtdPtr xmlSAXParseDTD (xmlSAXHandlerPtr sax,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000345 const xmlChar *ExternalID,
346 const xmlChar *SystemID);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000347void xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
348void xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
349void xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
Daniel Veillarddd6b3671999-09-23 22:19:22 +0000350 const xmlChar* buffer,
Daniel Veillardb96e6431999-08-29 21:02:19 +0000351 const char* filename);
352void xmlDefaultSAXHandlerInit(void);
353void htmlDefaultSAXHandlerInit(void);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000354
Daniel Veillardb96e6431999-08-29 21:02:19 +0000355/**
356 * Node infos
357 */
358const xmlParserNodeInfo*
359 xmlParserFindNodeInfo (const xmlParserCtxt* ctxt,
Daniel Veillard1e346af1999-02-22 10:33:01 +0000360 const xmlNode* node);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000361void xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
362void xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000363unsigned long xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeq* seq,
364 const xmlNode* node);
Daniel Veillardb96e6431999-08-29 21:02:19 +0000365void xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
366 const xmlParserNodeInfo* info);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000367
Daniel Veillardb96e6431999-08-29 21:02:19 +0000368/*
369 * External entities handling actually implemented in xmlIO
370 */
371
372void xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
373xmlExternalEntityLoader
374 xmlGetExternalEntityLoader(void);
375xmlParserInputPtr
376 xmlLoadExternalEntity (const char *URL,
377 const char *ID,
378 xmlParserInputPtr context);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000379#ifdef __cplusplus
380}
381#endif
382
383#endif /* __XML_PARSER_H__ */
384