Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

parser.h

Go to the documentation of this file.
00001 /*
00002  * parser.h : Interfaces, constants and types related to the XML parser.
00003  *
00004  * See Copyright for the status of this software.
00005  *
00006  * daniel@veillard.com
00007  */
00008 
00009 #ifndef __XML_PARSER_H__
00010 #define __XML_PARSER_H__
00011 
00012 #include <stdarg.h>
00013 
00014 #include <libxml/xmlversion.h>
00015 #include <libxml/tree.h>
00016 #include <libxml/dict.h>
00017 #include <libxml/hash.h>
00018 #include <libxml/valid.h>
00019 #include <libxml/entities.h>
00020 #include <libxml/xmlerror.h>
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00031 #define XML_DEFAULT_VERSION     "1.0"
00032 
00050 typedef void (* xmlParserInputDeallocate)(xmlChar *str);
00051 
00052 struct _xmlParserInput {
00053     /* Input buffer */
00054     xmlParserInputBufferPtr buf;      /* UTF-8 encoded buffer */
00055 
00056     const char *filename;             /* The file analyzed, if any */
00057     const char *directory;            /* the directory/base of the file */
00058     const xmlChar *base;              /* Base of the array to parse */
00059     const xmlChar *cur;               /* Current char being parsed */
00060     const xmlChar *end;               /* end of the array to parse */
00061     int length;                       /* length if known */
00062     int line;                         /* Current line */
00063     int col;                          /* Current column */
00064     /*
00065      * NOTE: consumed is only tested for equality in the parser code,
00066      *       so even if there is an overflow this should not give troubles
00067      *       for parsing very large instances.
00068      */
00069     unsigned long consumed;           /* How many xmlChars already consumed */
00070     xmlParserInputDeallocate free;    /* function to deallocate the base */
00071     const xmlChar *encoding;          /* the encoding string for entity */
00072     const xmlChar *version;           /* the version string for entity */
00073     int standalone;                   /* Was that entity marked standalone */
00074     int id;                           /* an unique identifier for the entity */
00075 };
00076 
00084 typedef struct _xmlParserNodeInfo xmlParserNodeInfo;
00085 typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
00086 
00087 struct _xmlParserNodeInfo {
00088   const struct _xmlNode* node;
00089   /* Position & line # that text that created the node begins & ends on */
00090   unsigned long begin_pos;
00091   unsigned long begin_line;
00092   unsigned long end_pos;
00093   unsigned long end_line;
00094 };
00095 
00096 typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
00097 typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
00098 struct _xmlParserNodeInfoSeq {
00099   unsigned long maximum;
00100   unsigned long length;
00101   xmlParserNodeInfo* buffer;
00102 };
00103 
00110 typedef enum {
00111     XML_PARSER_EOF = -1,        /* nothing is to be parsed */
00112     XML_PARSER_START = 0,       /* nothing has been parsed */
00113     XML_PARSER_MISC,            /* Misc* before int subset */
00114     XML_PARSER_PI,              /* Within a processing instruction */
00115     XML_PARSER_DTD,             /* within some DTD content */
00116     XML_PARSER_PROLOG,          /* Misc* after internal subset */
00117     XML_PARSER_COMMENT,         /* within a comment */
00118     XML_PARSER_START_TAG,       /* within a start tag */
00119     XML_PARSER_CONTENT,         /* within the content */
00120     XML_PARSER_CDATA_SECTION,   /* within a CDATA section */
00121     XML_PARSER_END_TAG,         /* within a closing tag */
00122     XML_PARSER_ENTITY_DECL,     /* within an entity declaration */
00123     XML_PARSER_ENTITY_VALUE,    /* within an entity value in a decl */
00124     XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */
00125     XML_PARSER_SYSTEM_LITERAL,  /* within a SYSTEM value */
00126     XML_PARSER_EPILOG,          /* the Misc* after the last end tag */
00127     XML_PARSER_IGNORE,          /* within an IGNORED section */
00128     XML_PARSER_PUBLIC_LITERAL   /* within a PUBLIC value */
00129 } xmlParserInputState;
00130 
00137 #define XML_DETECT_IDS          2
00138 
00146 #define XML_COMPLETE_ATTRS      4
00147 
00154 #define XML_SKIP_IDS            8
00155 
00168 struct _xmlParserCtxt {
00169     struct _xmlSAXHandler *sax;       /* The SAX handler */
00170     void            *userData;        /* For SAX interface only, used by DOM build */
00171     xmlDocPtr           myDoc;        /* the document being built */
00172     int            wellFormed;        /* is the document well formed */
00173     int       replaceEntities;        /* shall we replace entities ? */
00174     const xmlChar    *version;        /* the XML version string */
00175     const xmlChar   *encoding;        /* the declared encoding, if any */
00176     int            standalone;        /* standalone document */
00177     int                  html;        /* an HTML(1)/Docbook(2) document */
00178 
00179     /* Input stream stack */
00180     xmlParserInputPtr  input;         /* Current input stream */
00181     int                inputNr;       /* Number of current input streams */
00182     int                inputMax;      /* Max number of input streams */
00183     xmlParserInputPtr *inputTab;      /* stack of inputs */
00184 
00185     /* Node analysis stack only used for DOM building */
00186     xmlNodePtr         node;          /* Current parsed Node */
00187     int                nodeNr;        /* Depth of the parsing stack */
00188     int                nodeMax;       /* Max depth of the parsing stack */
00189     xmlNodePtr        *nodeTab;       /* array of nodes */
00190 
00191     int record_info;                  /* Whether node info should be kept */
00192     xmlParserNodeInfoSeq node_seq;    /* info about each node parsed */
00193 
00194     int errNo;                        /* error code */
00195 
00196     int     hasExternalSubset;        /* reference and external subset */
00197     int             hasPErefs;        /* the internal subset has PE refs */
00198     int              external;        /* are we parsing an external entity */
00199 
00200     int                 valid;        /* is the document valid */
00201     int              validate;        /* shall we try to validate ? */
00202     xmlValidCtxt        vctxt;        /* The validity context */
00203 
00204     xmlParserInputState instate;      /* current type of input */
00205     int                 token;        /* next char look-ahead */    
00206 
00207     char           *directory;        /* the data directory */
00208 
00209     /* Node name stack */
00210     const xmlChar     *name;          /* Current parsed Node */
00211     int                nameNr;        /* Depth of the parsing stack */
00212     int                nameMax;       /* Max depth of the parsing stack */
00213     const xmlChar *   *nameTab;       /* array of nodes */
00214 
00215     long               nbChars;       /* number of xmlChar processed */
00216     long            checkIndex;       /* used by progressive parsing lookup */
00217     int             keepBlanks;       /* ugly but ... */
00218     int             disableSAX;       /* SAX callbacks are disabled */
00219     int               inSubset;       /* Parsing is in int 1/ext 2 subset */
00220     const xmlChar *    intSubName;    /* name of subset */
00221     xmlChar *          extSubURI;     /* URI of external subset */
00222     xmlChar *          extSubSystem;  /* SYSTEM ID of external subset */
00223 
00224     /* xml:space values */
00225     int *              space;         /* Should the parser preserve spaces */
00226     int                spaceNr;       /* Depth of the parsing stack */
00227     int                spaceMax;      /* Max depth of the parsing stack */
00228     int *              spaceTab;      /* array of space infos */
00229 
00230     int                depth;         /* to prevent entity substitution loops */
00231     xmlParserInputPtr  entity;        /* used to check entities boundaries */
00232     int                charset;       /* encoding of the in-memory content
00233                                          actually an xmlCharEncoding */
00234     int                nodelen;       /* Those two fields are there to */
00235     int                nodemem;       /* Speed up large node parsing */
00236     int                pedantic;      /* signal pedantic warnings */
00237     void              *_private;      /* For user data, libxml won't touch it */
00238 
00239     int                loadsubset;    /* should the external subset be loaded */
00240     int                linenumbers;   /* set line number in element content */
00241     void              *catalogs;       /* document's own catalog */
00242     int                recovery;      /* run in recovery mode */
00243     int                progressive;   /* is this a progressive parsing */
00244     xmlDictPtr         dict;          /* dictionnary for the parser */
00245     const xmlChar *   *atts;          /* array for the attributes callbacks */
00246     int                maxatts;       /* the size of the array */
00247     int                docdict;       /* use strings from dict to build tree */
00248 
00249     /*
00250      * pre-interned strings
00251      */
00252     const xmlChar *str_xml;
00253     const xmlChar *str_xmlns;
00254     const xmlChar *str_xml_ns;
00255 
00256     /*
00257      * Everything below is used only by the new SAX mode
00258      */
00259     int                sax2;          /* operating in the new SAX mode */
00260     int                nsNr;          /* the number of inherited namespaces */
00261     int                nsMax;         /* the size of the arrays */
00262     const xmlChar *   *nsTab;         /* the array of prefix/namespace name */
00263     int               *attallocs;     /* which attribute were allocated */
00264     void *            *pushTab;       /* array of data for push */
00265     xmlHashTablePtr    attsDefault;   /* defaulted attributes if any */
00266     xmlHashTablePtr    attsSpecial;   /* non-CDATA attributes if any */
00267     int                nsWellFormed;  /* is the document XML Nanespace okay */
00268     int                options;       /* Extra options */
00269 
00270     /*
00271      * Those fields are needed only for treaming parsing so far
00272      */
00273     int               dictNames;    /* Use dictionary names for the tree */
00274     int               freeElemsNr;  /* number of freed element nodes */
00275     xmlNodePtr        freeElems;    /* List of freed element nodes */
00276     int               freeAttrsNr;  /* number of freed attributes nodes */
00277     xmlAttrPtr        freeAttrs;    /* List of freed attributes nodes */
00278 
00279     /*
00280      * the complete error informations for the last error.
00281      */
00282     xmlError          lastError;
00283 };
00284 
00290 struct _xmlSAXLocator {
00291     const xmlChar *(*getPublicId)(void *ctx);
00292     const xmlChar *(*getSystemId)(void *ctx);
00293     int (*getLineNumber)(void *ctx);
00294     int (*getColumnNumber)(void *ctx);
00295 };
00296 
00319 typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
00320                                 const xmlChar *publicId,
00321                                 const xmlChar *systemId);
00331 typedef void (*internalSubsetSAXFunc) (void *ctx,
00332                                 const xmlChar *name,
00333                                 const xmlChar *ExternalID,
00334                                 const xmlChar *SystemID);
00344 typedef void (*externalSubsetSAXFunc) (void *ctx,
00345                                 const xmlChar *name,
00346                                 const xmlChar *ExternalID,
00347                                 const xmlChar *SystemID);
00357 typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
00358                                 const xmlChar *name);
00368 typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
00369                                 const xmlChar *name);
00381 typedef void (*entityDeclSAXFunc) (void *ctx,
00382                                 const xmlChar *name,
00383                                 int type,
00384                                 const xmlChar *publicId,
00385                                 const xmlChar *systemId,
00386                                 xmlChar *content);
00396 typedef void (*notationDeclSAXFunc)(void *ctx,
00397                                 const xmlChar *name,
00398                                 const xmlChar *publicId,
00399                                 const xmlChar *systemId);
00412 typedef void (*attributeDeclSAXFunc)(void *ctx,
00413                                 const xmlChar *elem,
00414                                 const xmlChar *fullname,
00415                                 int type,
00416                                 int def,
00417                                 const xmlChar *defaultValue,
00418                                 xmlEnumerationPtr tree);
00428 typedef void (*elementDeclSAXFunc)(void *ctx,
00429                                 const xmlChar *name,
00430                                 int type,
00431                                 xmlElementContentPtr content);
00442 typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
00443                                 const xmlChar *name,
00444                                 const xmlChar *publicId,
00445                                 const xmlChar *systemId,
00446                                 const xmlChar *notationName);
00455 typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
00456                                 xmlSAXLocatorPtr loc);
00463 typedef void (*startDocumentSAXFunc) (void *ctx);
00470 typedef void (*endDocumentSAXFunc) (void *ctx);
00479 typedef void (*startElementSAXFunc) (void *ctx,
00480                                 const xmlChar *name,
00481                                 const xmlChar **atts);
00489 typedef void (*endElementSAXFunc) (void *ctx,
00490                                 const xmlChar *name);
00502 typedef void (*attributeSAXFunc) (void *ctx,
00503                                 const xmlChar *name,
00504                                 const xmlChar *value);
00512 typedef void (*referenceSAXFunc) (void *ctx,
00513                                 const xmlChar *name);
00522 typedef void (*charactersSAXFunc) (void *ctx,
00523                                 const xmlChar *ch,
00524                                 int len);
00534 typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
00535                                 const xmlChar *ch,
00536                                 int len);
00545 typedef void (*processingInstructionSAXFunc) (void *ctx,
00546                                 const xmlChar *target,
00547                                 const xmlChar *data);
00555 typedef void (*commentSAXFunc) (void *ctx,
00556                                 const xmlChar *value);
00565 typedef void (*cdataBlockSAXFunc) (
00566                                 void *ctx,
00567                                 const xmlChar *value,
00568                                 int len);
00577 typedef void (*warningSAXFunc) (void *ctx,
00578                                 const char *msg, ...);
00587 typedef void (*errorSAXFunc) (void *ctx,
00588                                 const char *msg, ...);
00599 typedef void (*fatalErrorSAXFunc) (void *ctx,
00600                                 const char *msg, ...);
00609 typedef int (*isStandaloneSAXFunc) (void *ctx);
00618 typedef int (*hasInternalSubsetSAXFunc) (void *ctx);
00619 
00628 typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
00629 
00630 /************************************************************************
00631  *                                                                      *
00632  *                      The SAX version 2 API extensions                *
00633  *                                                                      *
00634  ************************************************************************/
00640 #define XML_SAX2_MAGIC 0xDEEDBEAF
00641 
00661 typedef void (*startElementNsSAX2Func) (void *ctx,
00662                                         const xmlChar *localname,
00663                                         const xmlChar *prefix,
00664                                         const xmlChar *URI,
00665                                         int nb_namespaces,
00666                                         const xmlChar **namespaces,
00667                                         int nb_attributes,
00668                                         int nb_defaulted,
00669                                         const xmlChar **attributes);
00670  
00682 typedef void (*endElementNsSAX2Func)   (void *ctx,
00683                                         const xmlChar *localname,
00684                                         const xmlChar *prefix,
00685                                         const xmlChar *URI);
00686 
00687 
00688 struct _xmlSAXHandler {
00689     internalSubsetSAXFunc internalSubset;
00690     isStandaloneSAXFunc isStandalone;
00691     hasInternalSubsetSAXFunc hasInternalSubset;
00692     hasExternalSubsetSAXFunc hasExternalSubset;
00693     resolveEntitySAXFunc resolveEntity;
00694     getEntitySAXFunc getEntity;
00695     entityDeclSAXFunc entityDecl;
00696     notationDeclSAXFunc notationDecl;
00697     attributeDeclSAXFunc attributeDecl;
00698     elementDeclSAXFunc elementDecl;
00699     unparsedEntityDeclSAXFunc unparsedEntityDecl;
00700     setDocumentLocatorSAXFunc setDocumentLocator;
00701     startDocumentSAXFunc startDocument;
00702     endDocumentSAXFunc endDocument;
00703     startElementSAXFunc startElement;
00704     endElementSAXFunc endElement;
00705     referenceSAXFunc reference;
00706     charactersSAXFunc characters;
00707     ignorableWhitespaceSAXFunc ignorableWhitespace;
00708     processingInstructionSAXFunc processingInstruction;
00709     commentSAXFunc comment;
00710     warningSAXFunc warning;
00711     errorSAXFunc error;
00712     fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
00713     getParameterEntitySAXFunc getParameterEntity;
00714     cdataBlockSAXFunc cdataBlock;
00715     externalSubsetSAXFunc externalSubset;
00716     unsigned int initialized;
00717     /* The following fields are extensions available only on version 2 */
00718     void *_private;
00719     startElementNsSAX2Func startElementNs;
00720     endElementNsSAX2Func endElementNs;
00721     xmlStructuredErrorFunc serror;
00722 };
00723 
00724 /*
00725  * SAX Version 1
00726  */
00727 typedef struct _xmlSAXHandlerV1 xmlSAXHandlerV1;
00728 typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr;
00729 struct _xmlSAXHandlerV1 {
00730     internalSubsetSAXFunc internalSubset;
00731     isStandaloneSAXFunc isStandalone;
00732     hasInternalSubsetSAXFunc hasInternalSubset;
00733     hasExternalSubsetSAXFunc hasExternalSubset;
00734     resolveEntitySAXFunc resolveEntity;
00735     getEntitySAXFunc getEntity;
00736     entityDeclSAXFunc entityDecl;
00737     notationDeclSAXFunc notationDecl;
00738     attributeDeclSAXFunc attributeDecl;
00739     elementDeclSAXFunc elementDecl;
00740     unparsedEntityDeclSAXFunc unparsedEntityDecl;
00741     setDocumentLocatorSAXFunc setDocumentLocator;
00742     startDocumentSAXFunc startDocument;
00743     endDocumentSAXFunc endDocument;
00744     startElementSAXFunc startElement;
00745     endElementSAXFunc endElement;
00746     referenceSAXFunc reference;
00747     charactersSAXFunc characters;
00748     ignorableWhitespaceSAXFunc ignorableWhitespace;
00749     processingInstructionSAXFunc processingInstruction;
00750     commentSAXFunc comment;
00751     warningSAXFunc warning;
00752     errorSAXFunc error;
00753     fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
00754     getParameterEntitySAXFunc getParameterEntity;
00755     cdataBlockSAXFunc cdataBlock;
00756     externalSubsetSAXFunc externalSubset;
00757     unsigned int initialized;
00758 };
00759 
00760 
00771 typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
00772                                          const char *ID,
00773                                          xmlParserCtxtPtr context);
00774 
00775 #ifdef __cplusplus
00776 }
00777 #endif
00778 
00779 #include <libxml/encoding.h>
00780 #include <libxml/xmlIO.h>
00781 #include <libxml/globals.h>
00782 
00783 #ifdef __cplusplus
00784 extern "C" {
00785 #endif
00786 
00787 
00788 /*
00789  * Init/Cleanup
00790  */
00791 XMLPUBFUN void XMLCALL          
00792                 xmlInitParser           (void);
00793 XMLPUBFUN void XMLCALL          
00794                 xmlCleanupParser        (void);
00795 
00796 /*
00797  * Input functions
00798  */
00799 XMLPUBFUN int XMLCALL           
00800                 xmlParserInputRead      (xmlParserInputPtr in,
00801                                          int len);
00802 XMLPUBFUN int XMLCALL           
00803                 xmlParserInputGrow      (xmlParserInputPtr in,
00804                                          int len);
00805 
00806 /*
00807  * xmlChar handling
00808  */
00809 XMLPUBFUN xmlChar * XMLCALL     
00810                 xmlStrdup               (const xmlChar *cur);
00811 XMLPUBFUN xmlChar * XMLCALL     
00812                 xmlStrndup              (const xmlChar *cur,
00813                                          int len);
00814 XMLPUBFUN xmlChar * XMLCALL     
00815                 xmlCharStrndup          (const char *cur,
00816                                          int len);
00817 XMLPUBFUN xmlChar * XMLCALL     
00818                 xmlCharStrdup           (const char *cur);
00819 XMLPUBFUN xmlChar * XMLCALL     
00820                 xmlStrsub               (const xmlChar *str,
00821                                          int start,
00822                                          int len);
00823 XMLPUBFUN const xmlChar * XMLCALL       
00824                 xmlStrchr               (const xmlChar *str,
00825                                          xmlChar val);
00826 XMLPUBFUN const xmlChar * XMLCALL       
00827                 xmlStrstr               (const xmlChar *str,
00828                                          const xmlChar *val);
00829 XMLPUBFUN const xmlChar * XMLCALL       
00830                 xmlStrcasestr           (const xmlChar *str,
00831                                          xmlChar *val);
00832 XMLPUBFUN int XMLCALL           
00833                 xmlStrcmp               (const xmlChar *str1,
00834                                          const xmlChar *str2);
00835 XMLPUBFUN int XMLCALL           
00836                 xmlStrncmp              (const xmlChar *str1,
00837                                          const xmlChar *str2,
00838                                          int len);
00839 XMLPUBFUN int XMLCALL           
00840                 xmlStrcasecmp           (const xmlChar *str1,
00841                                          const xmlChar *str2);
00842 XMLPUBFUN int XMLCALL           
00843                 xmlStrncasecmp          (const xmlChar *str1,
00844                                          const xmlChar *str2,
00845                                          int len);
00846 XMLPUBFUN int XMLCALL           
00847                 xmlStrEqual             (const xmlChar *str1,
00848                                          const xmlChar *str2);
00849 XMLPUBFUN int XMLCALL
00850                 xmlStrQEqual            (const xmlChar *pref,
00851                                          const xmlChar *name,
00852                                          const xmlChar *str);
00853 XMLPUBFUN int XMLCALL           
00854                 xmlStrlen               (const xmlChar *str);
00855 XMLPUBFUN xmlChar * XMLCALL     
00856                 xmlStrcat               (xmlChar *cur,
00857                                          const xmlChar *add);
00858 XMLPUBFUN xmlChar * XMLCALL     
00859                 xmlStrncat              (xmlChar *cur,
00860                                          const xmlChar *add,
00861                                          int len);
00862 
00863 XMLPUBFUN int XMLCALL   
00864                 xmlStrPrintf            (xmlChar *buf,
00865                                          int len,
00866                                          const xmlChar *msg,
00867                                          ...);
00868 
00869 XMLPUBFUN int XMLCALL   
00870                 xmlStrVPrintf           (xmlChar *buf,
00871                                          int len,
00872                                          const xmlChar *msg,
00873                                          va_list ap);
00874 
00875 /*
00876  * Basic parsing Interfaces
00877  */
00878 XMLPUBFUN xmlDocPtr XMLCALL     
00879                 xmlParseDoc             (xmlChar *cur);
00880 XMLPUBFUN xmlDocPtr XMLCALL     
00881                 xmlParseMemory          (const char *buffer,
00882                                          int size);
00883 XMLPUBFUN xmlDocPtr XMLCALL     
00884                 xmlParseFile            (const char *filename);
00885 XMLPUBFUN int XMLCALL           
00886                 xmlSubstituteEntitiesDefault(int val);
00887 XMLPUBFUN int XMLCALL           
00888                 xmlKeepBlanksDefault    (int val);
00889 XMLPUBFUN void XMLCALL          
00890                 xmlStopParser           (xmlParserCtxtPtr ctxt);
00891 XMLPUBFUN int XMLCALL           
00892                 xmlPedanticParserDefault(int val);
00893 XMLPUBFUN int XMLCALL           
00894                 xmlLineNumbersDefault   (int val);
00895 
00896 /*
00897  * Recovery mode 
00898  */
00899 XMLPUBFUN xmlDocPtr XMLCALL     
00900                 xmlRecoverDoc           (xmlChar *cur);
00901 XMLPUBFUN xmlDocPtr XMLCALL     
00902                 xmlRecoverMemory        (const char *buffer,
00903                                          int size);
00904 XMLPUBFUN xmlDocPtr XMLCALL     
00905                 xmlRecoverFile          (const char *filename);
00906 
00907 /*
00908  * Less common routines and SAX interfaces
00909  */
00910 XMLPUBFUN int XMLCALL           
00911                 xmlParseDocument        (xmlParserCtxtPtr ctxt);
00912 XMLPUBFUN int XMLCALL           
00913                 xmlParseExtParsedEnt    (xmlParserCtxtPtr ctxt);
00914 XMLPUBFUN xmlDocPtr XMLCALL     
00915                 xmlSAXParseDoc          (xmlSAXHandlerPtr sax,
00916                                          xmlChar *cur,
00917                                          int recovery);
00918 XMLPUBFUN int XMLCALL           
00919                 xmlSAXUserParseFile     (xmlSAXHandlerPtr sax,
00920                                          void *user_data,
00921                                          const char *filename);
00922 XMLPUBFUN int XMLCALL           
00923                 xmlSAXUserParseMemory   (xmlSAXHandlerPtr sax,
00924                                          void *user_data,
00925                                          const char *buffer,
00926                                          int size);
00927 XMLPUBFUN xmlDocPtr XMLCALL     
00928                 xmlSAXParseMemory       (xmlSAXHandlerPtr sax,
00929                                          const char *buffer,
00930                                          int size,
00931                                          int recovery);
00932 XMLPUBFUN xmlDocPtr XMLCALL     
00933                 xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
00934                                          const char *buffer,
00935                                          int size,
00936                                          int recovery,
00937                                          void *data);
00938 XMLPUBFUN xmlDocPtr XMLCALL     
00939                 xmlSAXParseFile         (xmlSAXHandlerPtr sax,
00940                                          const char *filename,
00941                                          int recovery);
00942 XMLPUBFUN xmlDocPtr XMLCALL     
00943                 xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
00944                                          const char *filename,
00945                                          int recovery,
00946                                          void *data);
00947 XMLPUBFUN xmlDocPtr XMLCALL     
00948                 xmlSAXParseEntity       (xmlSAXHandlerPtr sax,
00949                                          const char *filename);
00950 XMLPUBFUN xmlDocPtr XMLCALL     
00951                 xmlParseEntity          (const char *filename);
00952 XMLPUBFUN xmlDtdPtr XMLCALL     
00953                 xmlParseDTD             (const xmlChar *ExternalID,
00954                                          const xmlChar *SystemID);
00955 XMLPUBFUN xmlDtdPtr XMLCALL     
00956                 xmlSAXParseDTD          (xmlSAXHandlerPtr sax,
00957                                          const xmlChar *ExternalID,
00958                                          const xmlChar *SystemID);
00959 XMLPUBFUN xmlDtdPtr XMLCALL     
00960                 xmlIOParseDTD           (xmlSAXHandlerPtr sax,
00961                                          xmlParserInputBufferPtr input,
00962                                          xmlCharEncoding enc);
00963 XMLPUBFUN int XMLCALL   
00964                 xmlParseBalancedChunkMemory(xmlDocPtr doc,
00965                                          xmlSAXHandlerPtr sax,
00966                                          void *user_data,
00967                                          int depth,
00968                                          const xmlChar *string,
00969                                          xmlNodePtr *lst);
00970 XMLPUBFUN int XMLCALL          
00971                 xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
00972                      xmlSAXHandlerPtr sax,
00973                      void *user_data,
00974                      int depth,
00975                      const xmlChar *string,
00976                      xmlNodePtr *lst,
00977                      int recover);
00978 XMLPUBFUN int XMLCALL           
00979                 xmlParseExternalEntity  (xmlDocPtr doc,
00980                                          xmlSAXHandlerPtr sax,
00981                                          void *user_data,
00982                                          int depth,
00983                                          const xmlChar *URL,
00984                                          const xmlChar *ID,
00985                                          xmlNodePtr *lst);
00986 XMLPUBFUN int XMLCALL           
00987                 xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
00988                                          const xmlChar *URL,
00989                                          const xmlChar *ID,
00990                                          xmlNodePtr *lst);
00991 
00992 /*
00993  * Parser contexts handling.
00994  */
00995 XMLPUBFUN xmlParserCtxtPtr XMLCALL      
00996                 xmlNewParserCtxt        (void);
00997 XMLPUBFUN int XMLCALL           
00998                 xmlInitParserCtxt       (xmlParserCtxtPtr ctxt);
00999 XMLPUBFUN void XMLCALL          
01000                 xmlClearParserCtxt      (xmlParserCtxtPtr ctxt);
01001 XMLPUBFUN void XMLCALL          
01002                 xmlFreeParserCtxt       (xmlParserCtxtPtr ctxt);
01003 XMLPUBFUN void XMLCALL          
01004                 xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
01005                                          const xmlChar* buffer,
01006                                          const char *filename);
01007 XMLPUBFUN xmlParserCtxtPtr XMLCALL 
01008                 xmlCreateDocParserCtxt  (const xmlChar *cur);
01009 
01010 /*
01011  * Reading/setting optional parsing features.
01012  */
01013 
01014 XMLPUBFUN int XMLCALL           
01015                 xmlGetFeaturesList      (int *len,
01016                                          const char **result);
01017 XMLPUBFUN int XMLCALL           
01018                 xmlGetFeature           (xmlParserCtxtPtr ctxt,
01019                                          const char *name,
01020                                          void *result);
01021 XMLPUBFUN int XMLCALL           
01022                 xmlSetFeature           (xmlParserCtxtPtr ctxt,
01023                                          const char *name,
01024                                          void *value);
01025 
01026 #ifdef LIBXML_PUSH_ENABLED
01027 /*
01028  * Interfaces for the Push mode.
01029  */
01030 XMLPUBFUN xmlParserCtxtPtr XMLCALL 
01031                 xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
01032                                          void *user_data,
01033                                          const char *chunk,
01034                                          int size,
01035                                          const char *filename);
01036 XMLPUBFUN int XMLCALL            
01037                 xmlParseChunk           (xmlParserCtxtPtr ctxt,
01038                                          const char *chunk,
01039                                          int size,
01040                                          int terminate);
01041 #endif /* LIBXML_PUSH_ENABLED */
01042 
01043 /*
01044  * Special I/O mode.
01045  */
01046 
01047 XMLPUBFUN xmlParserCtxtPtr XMLCALL 
01048                 xmlCreateIOParserCtxt   (xmlSAXHandlerPtr sax,
01049                                          void *user_data,
01050                                          xmlInputReadCallback   ioread,
01051                                          xmlInputCloseCallback  ioclose,
01052                                          void *ioctx,
01053                                          xmlCharEncoding enc);
01054 
01055 XMLPUBFUN xmlParserInputPtr XMLCALL 
01056                 xmlNewIOInputStream     (xmlParserCtxtPtr ctxt,
01057                                          xmlParserInputBufferPtr input,
01058                                          xmlCharEncoding enc);
01059 
01060 /*
01061  * Node infos.
01062  */
01063 XMLPUBFUN const xmlParserNodeInfo* XMLCALL
01064                 xmlParserFindNodeInfo   (const xmlParserCtxtPtr ctxt,
01065                                          const xmlNodePtr node);
01066 XMLPUBFUN void XMLCALL          
01067                 xmlInitNodeInfoSeq      (xmlParserNodeInfoSeqPtr seq);
01068 XMLPUBFUN void XMLCALL          
01069                 xmlClearNodeInfoSeq     (xmlParserNodeInfoSeqPtr seq);
01070 XMLPUBFUN unsigned long XMLCALL 
01071                 xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
01072                                          const xmlNodePtr node);
01073 XMLPUBFUN void XMLCALL          
01074                 xmlParserAddNodeInfo    (xmlParserCtxtPtr ctxt,
01075                                          const xmlParserNodeInfoPtr info);
01076 
01077 /*
01078  * External entities handling actually implemented in xmlIO.
01079  */
01080 
01081 XMLPUBFUN void XMLCALL          
01082                 xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
01083 XMLPUBFUN xmlExternalEntityLoader XMLCALL
01084                 xmlGetExternalEntityLoader(void);
01085 XMLPUBFUN xmlParserInputPtr XMLCALL
01086                 xmlLoadExternalEntity   (const char *URL,
01087                                          const char *ID,
01088                                          xmlParserCtxtPtr ctxt);
01089 /*
01090  * New set of simpler/more flexible APIs
01091  */
01098 typedef enum {
01099     XML_PARSE_RECOVER   = 1<<0, /* recover on errors */
01100     XML_PARSE_NOENT     = 1<<1, /* substitute entities */
01101     XML_PARSE_DTDLOAD   = 1<<2, /* load the external subset */
01102     XML_PARSE_DTDATTR   = 1<<3, /* default DTD attributes */
01103     XML_PARSE_DTDVALID  = 1<<4, /* validate with the DTD */
01104     XML_PARSE_NOERROR   = 1<<5, /* suppress error reports */
01105     XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */
01106     XML_PARSE_PEDANTIC  = 1<<7, /* pedantic error reporting */
01107     XML_PARSE_NOBLANKS  = 1<<8, /* remove blank nodes */
01108     XML_PARSE_SAX1      = 1<<9, /* use the SAX1 interface internally */
01109     XML_PARSE_XINCLUDE  = 1<<10,/* Implement XInclude substitition  */
01110     XML_PARSE_NONET     = 1<<11,/* Forbid network access */
01111     XML_PARSE_NODICT    = 1<<12,/* Do not reuse the context dictionnary */
01112     XML_PARSE_NSCLEAN   = 1<<13,/* remove redundant namespaces declarations */
01113     XML_PARSE_NOCDATA   = 1<<14 /* merge CDATA as text nodes */
01114 } xmlParserOption;
01115 
01116 XMLPUBFUN void XMLCALL
01117                 xmlCtxtReset            (xmlParserCtxtPtr ctxt);
01118 XMLPUBFUN int XMLCALL
01119                 xmlCtxtResetPush        (xmlParserCtxtPtr ctxt,
01120                                          const char *chunk,
01121                                          int size,
01122                                          const char *filename,
01123                                          const char *encoding);
01124 XMLPUBFUN int XMLCALL
01125                 xmlCtxtUseOptions       (xmlParserCtxtPtr ctxt,
01126                                          int options);
01127 XMLPUBFUN xmlDocPtr XMLCALL
01128                 xmlReadDoc              (const xmlChar *cur,
01129                                          const char *URL,
01130                                          const char *encoding,
01131                                          int options);
01132 XMLPUBFUN xmlDocPtr XMLCALL
01133                 xmlReadFile             (const char *URL,
01134                                          const char *encoding,
01135                                          int options);
01136 XMLPUBFUN xmlDocPtr XMLCALL
01137                 xmlReadMemory           (const char *buffer,
01138                                          int size,
01139                                          const char *URL,
01140                                          const char *encoding,
01141                                          int options);
01142 XMLPUBFUN xmlDocPtr XMLCALL
01143                 xmlReadFd               (int fd,
01144                                          const char *URL,
01145                                          const char *encoding,
01146                                          int options);
01147 XMLPUBFUN xmlDocPtr XMLCALL
01148                 xmlReadIO               (xmlInputReadCallback ioread,
01149                                          xmlInputCloseCallback ioclose,
01150                                          void *ioctx,
01151                                          const char *URL,
01152                                          const char *encoding,
01153                                          int options);
01154 XMLPUBFUN xmlDocPtr XMLCALL
01155                 xmlCtxtReadDoc          (xmlParserCtxtPtr ctxt,
01156                                          const xmlChar *cur,
01157                                          const char *URL,
01158                                          const char *encoding,
01159                                          int options);
01160 XMLPUBFUN xmlDocPtr XMLCALL
01161                 xmlCtxtReadFile         (xmlParserCtxtPtr ctxt,
01162                                          const char *filename,
01163                                          const char *encoding,
01164                                          int options);
01165 XMLPUBFUN xmlDocPtr XMLCALL
01166                 xmlCtxtReadMemory               (xmlParserCtxtPtr ctxt,
01167                                          const char *buffer,
01168                                          int size,
01169                                          const char *URL,
01170                                          const char *encoding,
01171                                          int options);
01172 XMLPUBFUN xmlDocPtr XMLCALL
01173                 xmlCtxtReadFd           (xmlParserCtxtPtr ctxt,
01174                                          int fd,
01175                                          const char *URL,
01176                                          const char *encoding,
01177                                          int options);
01178 XMLPUBFUN xmlDocPtr XMLCALL
01179                 xmlCtxtReadIO           (xmlParserCtxtPtr ctxt,
01180                                          xmlInputReadCallback ioread,
01181                                          xmlInputCloseCallback ioclose,
01182                                          void *ioctx,
01183                                          const char *URL,
01184                                          const char *encoding,
01185                                          int options);
01186 
01187 #ifdef __cplusplus
01188 }
01189 #endif
01190 #endif /* __XML_PARSER_H__ */
01191 
01192 

Generated on Wed Mar 16 00:10:27 2005 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1