1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

adding xmlSAXParseFileWithData following Marco Stipek suggestion Daniel

* win32/dsp/libxml2.def.src include/libxml/parser.h parser.c:
  adding xmlSAXParseFileWithData following Marco Stipek suggestion
Daniel
This commit is contained in:
Daniel Veillard
2001-10-02 13:54:14 +00:00
parent f4309d74b6
commit a293c32378
4 changed files with 41 additions and 3 deletions

View File

@ -9726,23 +9726,27 @@ xmlCreateFileParserCtxt(const char *filename)
}
/**
* xmlSAXParseFile:
* xmlSAXParseFileWithData:
* @sax: the SAX handler block
* @filename: the filename
* @recovery: work in recovery mode, i.e. tries to read no Well Formed
* documents
* @data: the userdata
*
* parse an XML file and build a tree. Automatic support for ZLIB/Compress
* compressed document is provided by default if found at compile-time.
* It use the given SAX function block to handle the parsing callback.
* If sax is NULL, fallback to the default DOM tree building routines.
*
* User data (void *) is stored within the parser context, so it is
* available nearly everywhere in libxml.
*
* Returns the resulting document tree
*/
xmlDocPtr
xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
int recovery) {
xmlSAXParseFileWithData(xmlSAXHandlerPtr sax, const char *filename,
int recovery, void *data) {
xmlDocPtr ret;
xmlParserCtxtPtr ctxt;
char *directory = NULL;
@ -9756,6 +9760,9 @@ xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
xmlFree(ctxt->sax);
ctxt->sax = sax;
}
if (data!=NULL) {
ctxt->_private=data;
}
if ((ctxt->directory == NULL) && (directory == NULL))
directory = xmlParserGetDirectory(filename);
@ -9777,6 +9784,27 @@ xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
return(ret);
}
/**
* xmlSAXParseFile:
* @sax: the SAX handler block
* @filename: the filename
* @recovery: work in recovery mode, i.e. tries to read no Well Formed
* documents
*
* parse an XML file and build a tree. Automatic support for ZLIB/Compress
* compressed document is provided by default if found at compile-time.
* It use the given SAX function block to handle the parsing callback.
* If sax is NULL, fallback to the default DOM tree building routines.
*
* Returns the resulting document tree
*/
xmlDocPtr
xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
int recovery) {
return(xmlSAXParseFileWithData(sax,filename,recovery,NULL));
}
/**
* xmlRecoverDoc:
* @cur: a pointer to an array of xmlChar