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

@ -1,3 +1,8 @@
Tue Oct 2 15:52:05 CEST 2001 Daniel Veillard <daniel@veillard.com>
* win32/dsp/libxml2.def.src include/libxml/parser.h parser.c:
adding xmlSAXParseFileWithData following Marco Stipek suggestion
Tue Oct 2 11:27:58 CEST 2001 Daniel Veillard <daniel@veillard.com>
* valid.c: close bug #61550 when xml: wasn't considered a namespace

View File

@ -456,6 +456,10 @@ xmlDocPtr xmlSAXParseMemory (xmlSAXHandlerPtr sax,
xmlDocPtr xmlSAXParseFile (xmlSAXHandlerPtr sax,
const char *filename,
int recovery);
xmlDocPtr xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
const char *filename,
int recovery,
void *data);
xmlDocPtr xmlSAXParseEntity (xmlSAXHandlerPtr sax,
const char *filename);
xmlDocPtr xmlParseEntity (const char *filename);

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

View File

@ -290,6 +290,7 @@ EXPORTS
xmlSAXUserParseMemory
xmlSAXParseMemory
xmlSAXParseFile
xmlSAXParseFileWithData
xmlSAXParseEntity
xmlParseEntity
xmlParseDTD