OLD | NEW |
1 /* | 1 /* |
2 * Summary: the core parser module | 2 * Summary: the core parser module |
3 * Description: Interfaces, constants and types related to the XML parser | 3 * Description: Interfaces, constants and types related to the XML parser |
4 * | 4 * |
5 * Copy: See Copyright for the status of this software. | 5 * Copy: See Copyright for the status of this software. |
6 * | 6 * |
7 * Author: Daniel Veillard | 7 * Author: Daniel Veillard |
8 */ | 8 */ |
9 | 9 |
10 #ifndef __XML_PARSER_H__ | 10 #ifndef __XML_PARSER_H__ |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 */ | 183 */ |
184 struct _xmlParserCtxt { | 184 struct _xmlParserCtxt { |
185 struct _xmlSAXHandler *sax; /* The SAX handler */ | 185 struct _xmlSAXHandler *sax; /* The SAX handler */ |
186 void *userData; /* For SAX interface only, used by DOM bui
ld */ | 186 void *userData; /* For SAX interface only, used by DOM bui
ld */ |
187 xmlDocPtr myDoc; /* the document being built */ | 187 xmlDocPtr myDoc; /* the document being built */ |
188 int wellFormed; /* is the document well formed */ | 188 int wellFormed; /* is the document well formed */ |
189 int replaceEntities; /* shall we replace entities ? */ | 189 int replaceEntities; /* shall we replace entities ? */ |
190 const xmlChar *version; /* the XML version string */ | 190 const xmlChar *version; /* the XML version string */ |
191 const xmlChar *encoding; /* the declared encoding, if any */ | 191 const xmlChar *encoding; /* the declared encoding, if any */ |
192 int standalone; /* standalone document */ | 192 int standalone; /* standalone document */ |
193 int html; /* an HTML(1)/Docbook(2) document */ | 193 int html; /* an HTML(1)/Docbook(2) document |
| 194 * 3 is HTML after <head> |
| 195 * 10 is HTML after <body> |
| 196 */ |
194 | 197 |
195 /* Input stream stack */ | 198 /* Input stream stack */ |
196 xmlParserInputPtr input; /* Current input stream */ | 199 xmlParserInputPtr input; /* Current input stream */ |
197 int inputNr; /* Number of current input streams */ | 200 int inputNr; /* Number of current input streams */ |
198 int inputMax; /* Max number of input streams */ | 201 int inputMax; /* Max number of input streams */ |
199 xmlParserInputPtr *inputTab; /* stack of inputs */ | 202 xmlParserInputPtr *inputTab; /* stack of inputs */ |
200 | 203 |
201 /* Node analysis stack only used for DOM building */ | 204 /* Node analysis stack only used for DOM building */ |
202 xmlNodePtr node; /* Current parsed Node */ | 205 xmlNodePtr node; /* Current parsed Node */ |
203 int nodeNr; /* Depth of the parsing stack */ | 206 int nodeNr; /* Depth of the parsing stack */ |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 const xmlChar *str_xmlns; | 272 const xmlChar *str_xmlns; |
270 const xmlChar *str_xml_ns; | 273 const xmlChar *str_xml_ns; |
271 | 274 |
272 /* | 275 /* |
273 * Everything below is used only by the new SAX mode | 276 * Everything below is used only by the new SAX mode |
274 */ | 277 */ |
275 int sax2; /* operating in the new SAX mode */ | 278 int sax2; /* operating in the new SAX mode */ |
276 int nsNr; /* the number of inherited namespaces */ | 279 int nsNr; /* the number of inherited namespaces */ |
277 int nsMax; /* the size of the arrays */ | 280 int nsMax; /* the size of the arrays */ |
278 const xmlChar * *nsTab; /* the array of prefix/namespace name */ | 281 const xmlChar * *nsTab; /* the array of prefix/namespace name */ |
279 struct _xmlParserCtxt *nsParent; /* parent context to inherit namespaces fr
om */ | |
280 int *attallocs; /* which attribute were allocated */ | 282 int *attallocs; /* which attribute were allocated */ |
281 void * *pushTab; /* array of data for push */ | 283 void * *pushTab; /* array of data for push */ |
282 xmlHashTablePtr attsDefault; /* defaulted attributes if any */ | 284 xmlHashTablePtr attsDefault; /* defaulted attributes if any */ |
283 xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */ | 285 xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */ |
284 int nsWellFormed; /* is the document XML Nanespace okay */ | 286 int nsWellFormed; /* is the document XML Nanespace okay */ |
285 int options; /* Extra options */ | 287 int options; /* Extra options */ |
286 | 288 |
287 /* | 289 /* |
288 * Those fields are needed only for treaming parsing so far | 290 * Those fields are needed only for treaming parsing so far |
289 */ | 291 */ |
290 int dictNames; /* Use dictionary names for the tree */ | 292 int dictNames; /* Use dictionary names for the tree */ |
291 int freeElemsNr; /* number of freed element nodes */ | 293 int freeElemsNr; /* number of freed element nodes */ |
292 xmlNodePtr freeElems; /* List of freed element nodes */ | 294 xmlNodePtr freeElems; /* List of freed element nodes */ |
293 int freeAttrsNr; /* number of freed attributes nodes */ | 295 int freeAttrsNr; /* number of freed attributes nodes */ |
294 xmlAttrPtr freeAttrs; /* List of freed attributes nodes */ | 296 xmlAttrPtr freeAttrs; /* List of freed attributes nodes */ |
295 | 297 |
296 /* | 298 /* |
297 * the complete error informations for the last error. | 299 * the complete error informations for the last error. |
298 */ | 300 */ |
299 xmlError lastError; | 301 xmlError lastError; |
300 xmlParserMode parseMode; /* the parser mode */ | 302 xmlParserMode parseMode; /* the parser mode */ |
| 303 unsigned long nbentities; /* number of entities references */ |
| 304 unsigned long sizeentities; /* size of parsed entities */ |
| 305 |
| 306 /* for use by HTML non-recursive parser */ |
| 307 xmlParserNodeInfo *nodeInfo; /* Current NodeInfo */ |
| 308 int nodeInfoNr; /* Depth of the parsing stack */ |
| 309 int nodeInfoMax; /* Max depth of the parsing stack */ |
| 310 xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */ |
301 }; | 311 }; |
302 | 312 |
303 /** | 313 /** |
304 * xmlSAXLocator: | 314 * xmlSAXLocator: |
305 * | 315 * |
306 * A SAX Locator. | 316 * A SAX Locator. |
307 */ | 317 */ |
308 struct _xmlSAXLocator { | 318 struct _xmlSAXLocator { |
309 const xmlChar *(*getPublicId)(void *ctx); | 319 const xmlChar *(*getPublicId)(void *ctx); |
310 const xmlChar *(*getSystemId)(void *ctx); | 320 const xmlChar *(*getSystemId)(void *ctx); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 int len); | 596 int len); |
587 /** | 597 /** |
588 * warningSAXFunc: | 598 * warningSAXFunc: |
589 * @ctx: an XML parser context | 599 * @ctx: an XML parser context |
590 * @msg: the message to display/transmit | 600 * @msg: the message to display/transmit |
591 * @...: extra parameters for the message display | 601 * @...: extra parameters for the message display |
592 * | 602 * |
593 * Display and format a warning messages, callback. | 603 * Display and format a warning messages, callback. |
594 */ | 604 */ |
595 typedef void (XMLCDECL *warningSAXFunc) (void *ctx, | 605 typedef void (XMLCDECL *warningSAXFunc) (void *ctx, |
596 » » » » const char *msg, ...); | 606 » » » » const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); |
597 /** | 607 /** |
598 * errorSAXFunc: | 608 * errorSAXFunc: |
599 * @ctx: an XML parser context | 609 * @ctx: an XML parser context |
600 * @msg: the message to display/transmit | 610 * @msg: the message to display/transmit |
601 * @...: extra parameters for the message display | 611 * @...: extra parameters for the message display |
602 * | 612 * |
603 * Display and format an error messages, callback. | 613 * Display and format an error messages, callback. |
604 */ | 614 */ |
605 typedef void (XMLCDECL *errorSAXFunc) (void *ctx, | 615 typedef void (XMLCDECL *errorSAXFunc) (void *ctx, |
606 » » » » const char *msg, ...); | 616 » » » » const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); |
607 /** | 617 /** |
608 * fatalErrorSAXFunc: | 618 * fatalErrorSAXFunc: |
609 * @ctx: an XML parser context | 619 * @ctx: an XML parser context |
610 * @msg: the message to display/transmit | 620 * @msg: the message to display/transmit |
611 * @...: extra parameters for the message display | 621 * @...: extra parameters for the message display |
612 * | 622 * |
613 * Display and format fatal error messages, callback. | 623 * Display and format fatal error messages, callback. |
614 * Note: so far fatalError() SAX callbacks are not used, error() | 624 * Note: so far fatalError() SAX callbacks are not used, error() |
615 * get all the callbacks for errors. | 625 * get all the callbacks for errors. |
616 */ | 626 */ |
617 typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx, | 627 typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx, |
618 » » » » const char *msg, ...); | 628 » » » » const char *msg, ...) LIBXML_ATTR_FORMAT(2,3); |
619 /** | 629 /** |
620 * isStandaloneSAXFunc: | 630 * isStandaloneSAXFunc: |
621 * @ctx: the user data (XML parser context) | 631 * @ctx: the user data (XML parser context) |
622 * | 632 * |
623 * Is this document tagged standalone? | 633 * Is this document tagged standalone? |
624 * | 634 * |
625 * Returns 1 if true | 635 * Returns 1 if true |
626 */ | 636 */ |
627 typedef int (*isStandaloneSAXFunc) (void *ctx); | 637 typedef int (*isStandaloneSAXFunc) (void *ctx); |
628 /** | 638 /** |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 XMLPUBFUN int XMLCALL | 852 XMLPUBFUN int XMLCALL |
843 xmlPedanticParserDefault(int val); | 853 xmlPedanticParserDefault(int val); |
844 XMLPUBFUN int XMLCALL | 854 XMLPUBFUN int XMLCALL |
845 xmlLineNumbersDefault (int val); | 855 xmlLineNumbersDefault (int val); |
846 | 856 |
847 #ifdef LIBXML_SAX1_ENABLED | 857 #ifdef LIBXML_SAX1_ENABLED |
848 /* | 858 /* |
849 * Recovery mode | 859 * Recovery mode |
850 */ | 860 */ |
851 XMLPUBFUN xmlDocPtr XMLCALL | 861 XMLPUBFUN xmlDocPtr XMLCALL |
852 » » xmlRecoverDoc» » (xmlChar *cur); | 862 » » xmlRecoverDoc» » (const xmlChar *cur); |
853 XMLPUBFUN xmlDocPtr XMLCALL | 863 XMLPUBFUN xmlDocPtr XMLCALL |
854 xmlRecoverMemory (const char *buffer, | 864 xmlRecoverMemory (const char *buffer, |
855 int size); | 865 int size); |
856 XMLPUBFUN xmlDocPtr XMLCALL | 866 XMLPUBFUN xmlDocPtr XMLCALL |
857 xmlRecoverFile (const char *filename); | 867 xmlRecoverFile (const char *filename); |
858 #endif /* LIBXML_SAX1_ENABLED */ | 868 #endif /* LIBXML_SAX1_ENABLED */ |
859 | 869 |
860 /* | 870 /* |
861 * Less common routines and SAX interfaces | 871 * Less common routines and SAX interfaces |
862 */ | 872 */ |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */ | 1093 XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */ |
1084 XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ | 1094 XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ |
1085 XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ | 1095 XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ |
1086 XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */ | 1096 XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */ |
1087 XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */ | 1097 XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */ |
1088 XML_PARSE_NONET = 1<<11,/* Forbid network access */ | 1098 XML_PARSE_NONET = 1<<11,/* Forbid network access */ |
1089 XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionnary */ | 1099 XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionnary */ |
1090 XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ | 1100 XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ |
1091 XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */ | 1101 XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */ |
1092 XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */ | 1102 XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */ |
1093 XML_PARSE_COMPACT = 1<<16 /* compact small text nodes; no modification of | 1103 XML_PARSE_COMPACT = 1<<16,/* compact small text nodes; no modification of |
1094 the tree allowed afterwards (will possibly | 1104 the tree allowed afterwards (will possibly |
1095 crash if you try to modify the tree) */ | 1105 crash if you try to modify the tree) */ |
| 1106 XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */ |
| 1107 XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */ |
| 1108 XML_PARSE_HUGE = 1<<19, /* relax any hardcoded limit from the parser */ |
| 1109 XML_PARSE_OLDSAX = 1<<20 /* parse using SAX2 interface from before 2.7.0
*/ |
1096 } xmlParserOption; | 1110 } xmlParserOption; |
1097 | 1111 |
1098 XMLPUBFUN void XMLCALL | 1112 XMLPUBFUN void XMLCALL |
1099 xmlCtxtReset (xmlParserCtxtPtr ctxt); | 1113 xmlCtxtReset (xmlParserCtxtPtr ctxt); |
1100 XMLPUBFUN int XMLCALL | 1114 XMLPUBFUN int XMLCALL |
1101 xmlCtxtResetPush (xmlParserCtxtPtr ctxt, | 1115 xmlCtxtResetPush (xmlParserCtxtPtr ctxt, |
1102 const char *chunk, | 1116 const char *chunk, |
1103 int size, | 1117 int size, |
1104 const char *filename, | 1118 const char *filename, |
1105 const char *encoding); | 1119 const char *encoding); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 XML_WITH_NONE = 99999 /* just to be sure of allocation size */ | 1226 XML_WITH_NONE = 99999 /* just to be sure of allocation size */ |
1213 } xmlFeature; | 1227 } xmlFeature; |
1214 | 1228 |
1215 XMLPUBFUN int XMLCALL | 1229 XMLPUBFUN int XMLCALL |
1216 xmlHasFeature (xmlFeature feature); | 1230 xmlHasFeature (xmlFeature feature); |
1217 | 1231 |
1218 #ifdef __cplusplus | 1232 #ifdef __cplusplus |
1219 } | 1233 } |
1220 #endif | 1234 #endif |
1221 #endif /* __XML_PARSER_H__ */ | 1235 #endif /* __XML_PARSER_H__ */ |
| 1236 |
OLD | NEW |