1998-08-13 03:39:55 +00:00
/*
1999-08-10 19:04:08 +00:00
* parser . h : Interfaces , constants and types related to the XML parser .
1998-08-13 03:39:55 +00:00
*
* See Copyright for the status of this software .
*
1999-01-17 19:11:59 +00:00
* Daniel . Veillard @ w3 . org
1998-08-13 03:39:55 +00:00
*/
# ifndef __XML_PARSER_H__
# define __XML_PARSER_H__
2000-04-03 19:48:13 +00:00
# include <libxml/tree.h>
# include <libxml/valid.h>
# include <libxml/xmlIO.h>
# include <libxml/entities.h>
1999-12-12 13:03:50 +00:00
1998-08-13 03:39:55 +00:00
# ifdef __cplusplus
extern " C " {
# endif
/*
* Constants .
*/
# define XML_DEFAULT_VERSION "1.0"
1999-08-10 19:04:08 +00:00
/**
* an xmlParserInput is an input flow for the XML processor .
* Each entity parsed is associated an xmlParserInput ( except the
* few predefined ones ) . This is the case both for internal entities
* - in which case the flow is already completely in memory - or
* external entities - in which case we use the buf structure for
* progressive reading and I18N conversions to the internal UTF - 8 format .
*/
1999-09-23 22:19:22 +00:00
typedef void ( * xmlParserInputDeallocate ) ( xmlChar * ) ;
2000-01-05 14:46:17 +00:00
typedef struct _xmlParserInput xmlParserInput ;
typedef xmlParserInput * xmlParserInputPtr ;
struct _xmlParserInput {
1999-06-22 21:49:07 +00:00
/* Input buffer */
xmlParserInputBufferPtr buf ; /* UTF-8 encoded buffer */
1998-08-13 03:39:55 +00:00
const char * filename ; /* The file analyzed, if any */
1999-08-10 19:04:08 +00:00
const char * directory ; /* the directory/base of teh file */
1999-12-28 16:35:14 +00:00
const xmlChar * base ; /* Base of the array to parse */
const xmlChar * cur ; /* Current char being parsed */
int length ; /* length if known */
1998-08-13 03:39:55 +00:00
int line ; /* Current line */
int col ; /* Current column */
1999-12-28 16:35:14 +00:00
int consumed ; /* How many xmlChars already consumed */
1999-02-28 21:54:31 +00:00
xmlParserInputDeallocate free ; /* function to deallocate the base */
2000-03-14 18:30:20 +00:00
const xmlChar * encoding ; /* the encoding string for entity */
const xmlChar * version ; /* the version string for entity */
int standalone ; /* Was that entity marked standalone */
2000-01-05 14:46:17 +00:00
} ;
1998-08-13 03:39:55 +00:00
1999-08-10 19:04:08 +00:00
/**
* the parser can be asked to collect Node informations , i . e . at what
* place in the file they were detected .
* NOTE : This is off by default and not very well tested .
*/
2000-01-05 14:46:17 +00:00
typedef struct _xmlParserNodeInfo xmlParserNodeInfo ;
typedef xmlParserNodeInfo * xmlParserNodeInfoPtr ;
struct _xmlParserNodeInfo {
const struct _xmlNode * node ;
1998-08-13 03:39:55 +00:00
/* Position & line # that text that created the node begins & ends on */
unsigned long begin_pos ;
unsigned long begin_line ;
unsigned long end_pos ;
unsigned long end_line ;
2000-01-05 14:46:17 +00:00
} ;
1998-08-13 03:39:55 +00:00
2000-01-05 14:46:17 +00:00
typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq ;
typedef xmlParserNodeInfoSeq * xmlParserNodeInfoSeqPtr ;
struct _xmlParserNodeInfoSeq {
1998-08-13 03:39:55 +00:00
unsigned long maximum ;
unsigned long length ;
xmlParserNodeInfo * buffer ;
2000-01-05 14:46:17 +00:00
} ;
1998-08-13 03:39:55 +00:00
1999-08-10 19:04:08 +00:00
/**
2000-01-05 14:46:17 +00:00
* The parser is now working also as a state based parser
* The recursive one use the stagte info for entities processing
1999-08-10 19:04:08 +00:00
*/
1999-10-08 09:40:39 +00:00
typedef enum {
1999-12-28 16:35:14 +00:00
XML_PARSER_EOF = - 1 , /* nothing is to be parsed */
XML_PARSER_START = 0 , /* nothing has been parsed */
XML_PARSER_MISC , /* Misc* before int subset */
XML_PARSER_PI , /* Whithin a processing instruction */
XML_PARSER_DTD , /* within some DTD content */
XML_PARSER_PROLOG , /* Misc* after internal subset */
XML_PARSER_COMMENT , /* within a comment */
XML_PARSER_START_TAG , /* within a start tag */
XML_PARSER_CONTENT , /* within the content */
XML_PARSER_CDATA_SECTION , /* within a CDATA section */
XML_PARSER_END_TAG , /* within a closing tag */
XML_PARSER_ENTITY_DECL , /* within an entity declaration */
XML_PARSER_ENTITY_VALUE , /* within an entity value in a decl */
XML_PARSER_ATTRIBUTE_VALUE , /* within an attribute value */
2000-03-14 18:30:20 +00:00
XML_PARSER_SYSTEM_LITERAL , /* within a SYSTEM value */
2000-11-13 11:47:47 +00:00
XML_PARSER_EPILOG , /* the Misc* after the last end tag */
XML_PARSER_IGNORE /* within an IGNORED section */
1999-08-10 19:04:08 +00:00
} xmlParserInputState ;
/**
* The parser context .
* NOTE This doesn ' t completely defines the parser state , the ( current ? )
* design of the parser uses recursive function calls since this allow
* and easy mapping from the production rules of the specification
* to the actual code . The drawback is that the actual function call
* also reflect the parser state . However most of the parsing routines
* takes as the only argument the parser context pointer , so migrating
* to a state based parser for progressive parsing shouldn ' t be too hard .
*/
2000-01-05 14:46:17 +00:00
typedef struct _xmlParserCtxt xmlParserCtxt ;
typedef xmlParserCtxt * xmlParserCtxtPtr ;
struct _xmlParserCtxt {
struct _xmlSAXHandler * sax ; /* The SAX handler */
2000-09-10 14:01:12 +00:00
void * userData ; /* For SAX interface only, used by DOM build */
1999-04-05 12:20:10 +00:00
xmlDocPtr myDoc ; /* the document being built */
1999-09-22 09:46:25 +00:00
int wellFormed ; /* is the document well formed */
1999-06-02 17:44:04 +00:00
int replaceEntities ; /* shall we replace entities ? */
2000-06-28 23:40:59 +00:00
const xmlChar * version ; /* the XML version string */
const xmlChar * encoding ; /* the declared encoding, if any */
1999-08-10 19:04:08 +00:00
int standalone ; /* standalone document */
2000-09-10 14:01:12 +00:00
int html ; /* an HTML(1)/Docbook(2) document */
1999-08-10 19:04:08 +00:00
1998-08-13 03:39:55 +00:00
/* Input stream stack */
xmlParserInputPtr input ; /* Current input stream */
int inputNr ; /* Number of current input streams */
int inputMax ; /* Max number of input streams */
xmlParserInputPtr * inputTab ; /* stack of inputs */
1999-08-10 19:04:08 +00:00
/* Node analysis stack only used for DOM building */
1998-08-13 03:39:55 +00:00
xmlNodePtr node ; /* Current parsed Node */
int nodeNr ; /* Depth of the parsing stack */
int nodeMax ; /* Max depth of the parsing stack */
xmlNodePtr * nodeTab ; /* array of nodes */
int record_info ; /* Whether node info should be kept */
xmlParserNodeInfoSeq node_seq ; /* info about each node parsed */
1999-09-22 09:46:25 +00:00
1999-09-23 22:19:22 +00:00
int errNo ; /* error code */
1999-09-22 09:46:25 +00:00
int hasExternalSubset ; /* reference and external subset */
int hasPErefs ; /* the internal subset has PE refs */
int external ; /* are we parsing an external entity */
int valid ; /* is the document valid */
int validate ; /* shall we try to validate ? */
xmlValidCtxt vctxt ; /* The validity context */
xmlParserInputState instate ; /* current type of input */
int token ; /* next char look-ahead */
char * directory ; /* the data directory */
1999-10-08 14:37:09 +00:00
2000-03-14 18:30:20 +00:00
/* Node name stack */
1999-10-08 14:37:09 +00:00
xmlChar * name ; /* Current parsed Node */
int nameNr ; /* Depth of the parsing stack */
int nameMax ; /* Max depth of the parsing stack */
xmlChar * * nameTab ; /* array of nodes */
1999-12-12 13:03:50 +00:00
long nbChars ; /* number of xmlChar processed */
1999-12-28 16:35:14 +00:00
long checkIndex ; /* used by progressive parsing lookup */
2000-03-02 03:33:32 +00:00
int keepBlanks ; /* ugly but ... */
2000-03-14 18:30:20 +00:00
int disableSAX ; /* SAX callbacks are disabled */
int inSubset ; /* Parsing is in int 1/ext 2 subset */
xmlChar * intSubName ; /* name of subset */
xmlChar * extSubURI ; /* URI of external subset */
xmlChar * extSubSystem ; /* SYSTEM ID of external subset */
/* xml:space values */
int * space ; /* Should the parser preserve spaces */
int spaceNr ; /* Depth of the parsing stack */
int spaceMax ; /* Max depth of the parsing stack */
int * spaceTab ; /* array of space infos */
int depth ; /* to prevent entity substitution loops */
2000-06-28 23:40:59 +00:00
xmlParserInputPtr entity ; /* used to check entities boundaries */
int charset ; /* encoding of the in-memory content
actually an xmlCharEncoding */
int nodelen ; /* Those two fields are there to */
int nodemem ; /* Speed up large node parsing */
2000-08-26 21:40:43 +00:00
int pedantic ; /* signal pedantic warnings */
2000-09-10 14:01:12 +00:00
void * _private ; /* For user data, libxml won't touch it */
2000-01-05 14:46:17 +00:00
} ;
1998-08-13 03:39:55 +00:00
1999-08-10 19:04:08 +00:00
/**
1998-08-13 03:39:55 +00:00
* a SAX Locator .
*/
2000-01-05 14:46:17 +00:00
typedef struct _xmlSAXLocator xmlSAXLocator ;
typedef xmlSAXLocator * xmlSAXLocatorPtr ;
struct _xmlSAXLocator {
1999-09-23 22:19:22 +00:00
const xmlChar * ( * getPublicId ) ( void * ctx ) ;
const xmlChar * ( * getSystemId ) ( void * ctx ) ;
1999-05-29 11:51:49 +00:00
int ( * getLineNumber ) ( void * ctx ) ;
int ( * getColumnNumber ) ( void * ctx ) ;
2000-01-05 14:46:17 +00:00
} ;
1998-08-13 03:39:55 +00:00
1999-08-10 19:04:08 +00:00
/**
* a SAX handler is bunch of callbacks called by the parser when processing
* of the input generate data or structure informations .
1998-08-13 03:39:55 +00:00
*/
1999-05-29 11:51:49 +00:00
typedef xmlParserInputPtr ( * resolveEntitySAXFunc ) ( void * ctx ,
1999-09-23 22:19:22 +00:00
const xmlChar * publicId , const xmlChar * systemId ) ;
typedef void ( * internalSubsetSAXFunc ) ( void * ctx , const xmlChar * name ,
const xmlChar * ExternalID , const xmlChar * SystemID ) ;
2000-03-14 18:30:20 +00:00
typedef void ( * externalSubsetSAXFunc ) ( void * ctx , const xmlChar * name ,
const xmlChar * ExternalID , const xmlChar * SystemID ) ;
1999-05-29 11:51:49 +00:00
typedef xmlEntityPtr ( * getEntitySAXFunc ) ( void * ctx ,
1999-09-23 22:19:22 +00:00
const xmlChar * name ) ;
1999-08-10 19:04:08 +00:00
typedef xmlEntityPtr ( * getParameterEntitySAXFunc ) ( void * ctx ,
1999-09-23 22:19:22 +00:00
const xmlChar * name ) ;
1999-05-29 11:51:49 +00:00
typedef void ( * entityDeclSAXFunc ) ( void * ctx ,
1999-09-23 22:19:22 +00:00
const xmlChar * name , int type , const xmlChar * publicId ,
const xmlChar * systemId , xmlChar * content ) ;
typedef void ( * notationDeclSAXFunc ) ( void * ctx , const xmlChar * name ,
const xmlChar * publicId , const xmlChar * systemId ) ;
typedef void ( * attributeDeclSAXFunc ) ( void * ctx , const xmlChar * elem ,
const xmlChar * name , int type , int def ,
const xmlChar * defaultValue , xmlEnumerationPtr tree ) ;
typedef void ( * elementDeclSAXFunc ) ( void * ctx , const xmlChar * name ,
1999-04-05 12:20:10 +00:00
int type , xmlElementContentPtr content ) ;
1999-05-29 11:51:49 +00:00
typedef void ( * unparsedEntityDeclSAXFunc ) ( void * ctx ,
1999-09-23 22:19:22 +00:00
const xmlChar * name , const xmlChar * publicId ,
const xmlChar * systemId , const xmlChar * notationName ) ;
1999-05-29 11:51:49 +00:00
typedef void ( * setDocumentLocatorSAXFunc ) ( void * ctx ,
1998-08-13 03:39:55 +00:00
xmlSAXLocatorPtr loc ) ;
1999-05-29 11:51:49 +00:00
typedef void ( * startDocumentSAXFunc ) ( void * ctx ) ;
typedef void ( * endDocumentSAXFunc ) ( void * ctx ) ;
1999-09-23 22:19:22 +00:00
typedef void ( * startElementSAXFunc ) ( void * ctx , const xmlChar * name ,
const xmlChar * * atts ) ;
typedef void ( * endElementSAXFunc ) ( void * ctx , const xmlChar * name ) ;
typedef void ( * attributeSAXFunc ) ( void * ctx , const xmlChar * name ,
const xmlChar * value ) ;
typedef void ( * referenceSAXFunc ) ( void * ctx , const xmlChar * name ) ;
typedef void ( * charactersSAXFunc ) ( void * ctx , const xmlChar * ch ,
1999-04-05 12:20:10 +00:00
int len ) ;
1999-05-29 11:51:49 +00:00
typedef void ( * ignorableWhitespaceSAXFunc ) ( void * ctx ,
1999-09-23 22:19:22 +00:00
const xmlChar * ch , int len ) ;
1999-05-29 11:51:49 +00:00
typedef void ( * processingInstructionSAXFunc ) ( void * ctx ,
1999-09-23 22:19:22 +00:00
const xmlChar * target , const xmlChar * data ) ;
typedef void ( * commentSAXFunc ) ( void * ctx , const xmlChar * value ) ;
typedef void ( * cdataBlockSAXFunc ) ( void * ctx , const xmlChar * value , int len ) ;
1999-05-29 11:51:49 +00:00
typedef void ( * warningSAXFunc ) ( void * ctx , const char * msg , . . . ) ;
typedef void ( * errorSAXFunc ) ( void * ctx , const char * msg , . . . ) ;
typedef void ( * fatalErrorSAXFunc ) ( void * ctx , const char * msg , . . . ) ;
typedef int ( * isStandaloneSAXFunc ) ( void * ctx ) ;
typedef int ( * hasInternalSubsetSAXFunc ) ( void * ctx ) ;
typedef int ( * hasExternalSubsetSAXFunc ) ( void * ctx ) ;
1998-08-13 03:39:55 +00:00
2000-01-05 14:46:17 +00:00
typedef struct _xmlSAXHandler xmlSAXHandler ;
typedef xmlSAXHandler * xmlSAXHandlerPtr ;
struct _xmlSAXHandler {
1999-04-05 12:20:10 +00:00
internalSubsetSAXFunc internalSubset ;
isStandaloneSAXFunc isStandalone ;
hasInternalSubsetSAXFunc hasInternalSubset ;
hasExternalSubsetSAXFunc hasExternalSubset ;
1998-08-13 03:39:55 +00:00
resolveEntitySAXFunc resolveEntity ;
1999-04-05 12:20:10 +00:00
getEntitySAXFunc getEntity ;
entityDeclSAXFunc entityDecl ;
1998-08-13 03:39:55 +00:00
notationDeclSAXFunc notationDecl ;
1999-04-05 12:20:10 +00:00
attributeDeclSAXFunc attributeDecl ;
elementDeclSAXFunc elementDecl ;
1998-08-13 03:39:55 +00:00
unparsedEntityDeclSAXFunc unparsedEntityDecl ;
setDocumentLocatorSAXFunc setDocumentLocator ;
startDocumentSAXFunc startDocument ;
endDocumentSAXFunc endDocument ;
startElementSAXFunc startElement ;
endElementSAXFunc endElement ;
1999-04-05 12:20:10 +00:00
referenceSAXFunc reference ;
1998-08-13 03:39:55 +00:00
charactersSAXFunc characters ;
ignorableWhitespaceSAXFunc ignorableWhitespace ;
processingInstructionSAXFunc processingInstruction ;
1999-04-05 12:20:10 +00:00
commentSAXFunc comment ;
1998-08-13 03:39:55 +00:00
warningSAXFunc warning ;
errorSAXFunc error ;
fatalErrorSAXFunc fatalError ;
1999-08-10 19:04:08 +00:00
getParameterEntitySAXFunc getParameterEntity ;
cdataBlockSAXFunc cdataBlock ;
2000-03-14 18:30:20 +00:00
externalSubsetSAXFunc externalSubset ;
2000-01-05 14:46:17 +00:00
} ;
1998-08-13 03:39:55 +00:00
2000-01-03 11:08:02 +00:00
/**
* External entity loaders types
*/
typedef xmlParserInputPtr ( * xmlExternalEntityLoader ) ( const char * URL ,
const char * ID ,
xmlParserCtxtPtr context ) ;
1999-08-10 19:04:08 +00:00
/**
1999-09-02 22:04:43 +00:00
* Global variables : just the default SAX interface tables and XML
* version infos .
1998-08-13 03:39:55 +00:00
*/
2000-11-07 14:21:01 +00:00
LIBXML_DLL_IMPORT extern const char * xmlParserVersion ;
1999-06-22 21:49:07 +00:00
2000-11-07 14:21:01 +00:00
LIBXML_DLL_IMPORT extern xmlSAXLocator xmlDefaultSAXLocator ;
LIBXML_DLL_IMPORT extern xmlSAXHandler xmlDefaultSAXHandler ;
LIBXML_DLL_IMPORT extern xmlSAXHandler htmlDefaultSAXHandler ;
LIBXML_DLL_IMPORT extern xmlSAXHandler sgmlDefaultSAXHandler ;
1998-08-13 03:39:55 +00:00
1999-09-02 22:04:43 +00:00
/**
* entity substitution default behaviour .
*/
2000-11-07 14:21:01 +00:00
LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultValue ;
LIBXML_DLL_IMPORT extern int xmlGetWarningsDefaultValue ;
1999-09-02 22:04:43 +00:00
1998-10-27 06:21:04 +00:00
1999-08-10 19:04:08 +00:00
/**
2000-10-01 18:23:35 +00:00
* Init / Cleanup
1999-07-27 19:52:06 +00:00
*/
2000-10-01 18:23:35 +00:00
void xmlInitParser ( void ) ;
1999-11-24 18:04:22 +00:00
void xmlCleanupParser ( void ) ;
1999-07-27 19:52:06 +00:00
1999-11-24 18:04:22 +00:00
/**
* Input functions
*/
1999-08-29 21:02:19 +00:00
int xmlParserInputRead ( xmlParserInputPtr in ,
int len ) ;
int xmlParserInputGrow ( xmlParserInputPtr in ,
int len ) ;
1999-07-27 19:52:06 +00:00
1999-08-10 19:04:08 +00:00
/**
1999-09-23 22:19:22 +00:00
* xmlChar handling
1998-08-13 03:39:55 +00:00
*/
1999-09-26 11:31:02 +00:00
xmlChar * xmlStrdup ( const xmlChar * cur ) ;
xmlChar * xmlStrndup ( const xmlChar * cur ,
1999-08-29 21:02:19 +00:00
int len ) ;
1999-09-26 11:31:02 +00:00
xmlChar * xmlStrsub ( const xmlChar * str ,
1999-08-29 21:02:19 +00:00
int start ,
int len ) ;
1999-09-23 22:19:22 +00:00
const xmlChar * xmlStrchr ( const xmlChar * str ,
xmlChar val ) ;
const xmlChar * xmlStrstr ( const xmlChar * str ,
xmlChar * val ) ;
2000-09-22 13:51:48 +00:00
const xmlChar * xmlStrcasestr ( const xmlChar * str ,
xmlChar * val ) ;
1999-09-23 22:19:22 +00:00
int xmlStrcmp ( const xmlChar * str1 ,
const xmlChar * str2 ) ;
int xmlStrncmp ( const xmlChar * str1 ,
const xmlChar * str2 ,
1999-08-29 21:02:19 +00:00
int len ) ;
2000-09-22 13:51:48 +00:00
int xmlStrcasecmp ( const xmlChar * str1 ,
const xmlChar * str2 ) ;
int xmlStrncasecmp ( const xmlChar * str1 ,
const xmlChar * str2 ,
int len ) ;
2000-10-01 20:28:44 +00:00
int xmlStrEqual ( const xmlChar * str1 ,
const xmlChar * str2 ) ;
1999-09-23 22:19:22 +00:00
int xmlStrlen ( const xmlChar * str ) ;
1999-09-26 11:31:02 +00:00
xmlChar * xmlStrcat ( xmlChar * cur ,
1999-09-23 22:19:22 +00:00
const xmlChar * add ) ;
1999-09-26 11:31:02 +00:00
xmlChar * xmlStrncat ( xmlChar * cur ,
1999-09-23 22:19:22 +00:00
const xmlChar * add ,
1999-08-29 21:02:19 +00:00
int len ) ;
1998-08-13 03:39:55 +00:00
1999-08-10 19:04:08 +00:00
/**
* Basic parsing Interfaces
1999-01-17 19:11:59 +00:00
*/
1999-09-23 22:19:22 +00:00
xmlDocPtr xmlParseDoc ( xmlChar * cur ) ;
1999-08-29 21:02:19 +00:00
xmlDocPtr xmlParseMemory ( char * buffer ,
int size ) ;
xmlDocPtr xmlParseFile ( const char * filename ) ;
int xmlSubstituteEntitiesDefault ( int val ) ;
2000-03-04 11:39:43 +00:00
int xmlKeepBlanksDefault ( int val ) ;
2000-06-30 17:58:25 +00:00
void xmlStopParser ( xmlParserCtxtPtr ctxt ) ;
2000-08-26 21:40:43 +00:00
int xmlPedanticParserDefault ( int val ) ;
1999-01-17 19:11:59 +00:00
1999-08-10 19:04:08 +00:00
/**
1999-01-17 19:11:59 +00:00
* Recovery mode
*/
1999-09-23 22:19:22 +00:00
xmlDocPtr xmlRecoverDoc ( xmlChar * cur ) ;
1999-08-29 21:02:19 +00:00
xmlDocPtr xmlRecoverMemory ( char * buffer ,
int size ) ;
xmlDocPtr xmlRecoverFile ( const char * filename ) ;
1999-01-17 19:11:59 +00:00
1999-08-10 19:04:08 +00:00
/**
* Less common routines and SAX interfaces
1999-01-17 19:11:59 +00:00
*/
1999-08-29 21:02:19 +00:00
int xmlParseDocument ( xmlParserCtxtPtr ctxt ) ;
2000-09-16 14:02:43 +00:00
int xmlParseExtParsedEnt ( xmlParserCtxtPtr ctxt ) ;
1999-08-29 21:02:19 +00:00
xmlDocPtr xmlSAXParseDoc ( xmlSAXHandlerPtr sax ,
1999-09-23 22:19:22 +00:00
xmlChar * cur ,
1999-08-29 21:02:19 +00:00
int recovery ) ;
1999-09-26 11:31:02 +00:00
int xmlSAXUserParseFile ( xmlSAXHandlerPtr sax ,
void * user_data ,
const char * filename ) ;
int xmlSAXUserParseMemory ( xmlSAXHandlerPtr sax ,
void * user_data ,
char * buffer ,
int size ) ;
1999-08-29 21:02:19 +00:00
xmlDocPtr xmlSAXParseMemory ( xmlSAXHandlerPtr sax ,
char * buffer ,
int size ,
int recovery ) ;
xmlDocPtr xmlSAXParseFile ( xmlSAXHandlerPtr sax ,
const char * filename ,
int recovery ) ;
2000-09-16 14:02:43 +00:00
xmlDocPtr xmlSAXParseEntity ( xmlSAXHandlerPtr sax ,
const char * filename ) ;
xmlDocPtr xmlParseEntity ( const char * filename ) ;
1999-09-23 22:19:22 +00:00
xmlDtdPtr xmlParseDTD ( const xmlChar * ExternalID ,
const xmlChar * SystemID ) ;
1999-08-29 21:02:19 +00:00
xmlDtdPtr xmlSAXParseDTD ( xmlSAXHandlerPtr sax ,
1999-09-23 22:19:22 +00:00
const xmlChar * ExternalID ,
const xmlChar * SystemID ) ;
2000-10-30 15:36:47 +00:00
xmlDtdPtr xmlIOParseDTD ( xmlSAXHandlerPtr sax ,
xmlParserInputBufferPtr input ,
xmlCharEncoding enc ) ;
2000-03-14 18:30:20 +00:00
int xmlParseBalancedChunkMemory ( xmlDocPtr doc ,
xmlSAXHandlerPtr sax ,
void * user_data ,
int depth ,
const xmlChar * string ,
xmlNodePtr * list ) ;
int xmlParseExternalEntity ( xmlDocPtr doc ,
xmlSAXHandlerPtr sax ,
void * user_data ,
int depth ,
const xmlChar * URL ,
const xmlChar * ID ,
xmlNodePtr * list ) ;
2000-08-12 21:12:04 +00:00
int xmlParseCtxtExternalEntity ( xmlParserCtxtPtr ctx ,
const xmlChar * URL ,
const xmlChar * ID ,
xmlNodePtr * list ) ;
2000-03-14 18:30:20 +00:00
1999-12-28 16:35:14 +00:00
/**
* SAX initialization routines
*/
void xmlDefaultSAXHandlerInit ( void ) ;
void htmlDefaultSAXHandlerInit ( void ) ;
/**
* Parser contexts handling .
*/
1999-08-29 21:02:19 +00:00
void xmlInitParserCtxt ( xmlParserCtxtPtr ctxt ) ;
void xmlClearParserCtxt ( xmlParserCtxtPtr ctxt ) ;
1999-12-28 16:35:14 +00:00
void xmlFreeParserCtxt ( xmlParserCtxtPtr ctxt ) ;
1999-08-29 21:02:19 +00:00
void xmlSetupParserForBuffer ( xmlParserCtxtPtr ctxt ,
1999-09-23 22:19:22 +00:00
const xmlChar * buffer ,
1999-08-29 21:02:19 +00:00
const char * filename ) ;
1999-12-28 16:35:14 +00:00
xmlParserCtxtPtr xmlCreateDocParserCtxt ( xmlChar * cur ) ;
2000-08-12 21:12:04 +00:00
/**
* Reading / setting optional parsing features .
*/
int xmlGetFeaturesList ( int * len ,
const char * * result ) ;
int xmlGetFeature ( xmlParserCtxtPtr ctxt ,
const char * name ,
void * result ) ;
int xmlSetFeature ( xmlParserCtxtPtr ctxt ,
const char * name ,
void * value ) ;
1999-12-28 16:35:14 +00:00
/**
* Interfaces for the Push mode
*/
xmlParserCtxtPtr xmlCreatePushParserCtxt ( xmlSAXHandlerPtr sax ,
void * user_data ,
const char * chunk ,
int size ,
const char * filename ) ;
int xmlParseChunk ( xmlParserCtxtPtr ctxt ,
const char * chunk ,
int size ,
int terminate ) ;
1999-08-29 21:02:19 +00:00
2000-04-12 13:27:38 +00:00
/**
* Special I / O mode
*/
xmlParserCtxtPtr xmlCreateIOParserCtxt ( xmlSAXHandlerPtr sax ,
void * user_data ,
xmlInputReadCallback ioread ,
xmlInputCloseCallback ioclose ,
void * ioctx ,
xmlCharEncoding enc ) ;
xmlParserInputPtr xmlNewIOInputStream ( xmlParserCtxtPtr ctxt ,
xmlParserInputBufferPtr input ,
xmlCharEncoding enc ) ;
1999-08-29 21:02:19 +00:00
/**
* Node infos
*/
const xmlParserNodeInfo *
xmlParserFindNodeInfo ( const xmlParserCtxt * ctxt ,
1999-02-22 10:33:01 +00:00
const xmlNode * node ) ;
1999-08-29 21:02:19 +00:00
void xmlInitNodeInfoSeq ( xmlParserNodeInfoSeqPtr seq ) ;
void xmlClearNodeInfoSeq ( xmlParserNodeInfoSeqPtr seq ) ;
1998-08-13 03:39:55 +00:00
unsigned long xmlParserFindNodeInfoIndex ( const xmlParserNodeInfoSeq * seq ,
const xmlNode * node ) ;
1999-08-29 21:02:19 +00:00
void xmlParserAddNodeInfo ( xmlParserCtxtPtr ctxt ,
const xmlParserNodeInfo * info ) ;
/*
* External entities handling actually implemented in xmlIO
*/
1998-08-13 03:39:55 +00:00
1999-08-29 21:02:19 +00:00
void xmlSetExternalEntityLoader ( xmlExternalEntityLoader f ) ;
xmlExternalEntityLoader
xmlGetExternalEntityLoader ( void ) ;
xmlParserInputPtr
xmlLoadExternalEntity ( const char * URL ,
const char * ID ,
2000-01-03 11:08:02 +00:00
xmlParserCtxtPtr context ) ;
1999-12-12 13:03:50 +00:00
1998-08-13 03:39:55 +00:00
# ifdef __cplusplus
}
# endif
# endif /* __XML_PARSER_H__ */