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:
@ -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>
|
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
|
* valid.c: close bug #61550 when xml: wasn't considered a namespace
|
||||||
|
@ -456,6 +456,10 @@ xmlDocPtr xmlSAXParseMemory (xmlSAXHandlerPtr sax,
|
|||||||
xmlDocPtr xmlSAXParseFile (xmlSAXHandlerPtr sax,
|
xmlDocPtr xmlSAXParseFile (xmlSAXHandlerPtr sax,
|
||||||
const char *filename,
|
const char *filename,
|
||||||
int recovery);
|
int recovery);
|
||||||
|
xmlDocPtr xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
|
||||||
|
const char *filename,
|
||||||
|
int recovery,
|
||||||
|
void *data);
|
||||||
xmlDocPtr xmlSAXParseEntity (xmlSAXHandlerPtr sax,
|
xmlDocPtr xmlSAXParseEntity (xmlSAXHandlerPtr sax,
|
||||||
const char *filename);
|
const char *filename);
|
||||||
xmlDocPtr xmlParseEntity (const char *filename);
|
xmlDocPtr xmlParseEntity (const char *filename);
|
||||||
|
34
parser.c
34
parser.c
@ -9726,23 +9726,27 @@ xmlCreateFileParserCtxt(const char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlSAXParseFile:
|
* xmlSAXParseFileWithData:
|
||||||
* @sax: the SAX handler block
|
* @sax: the SAX handler block
|
||||||
* @filename: the filename
|
* @filename: the filename
|
||||||
* @recovery: work in recovery mode, i.e. tries to read no Well Formed
|
* @recovery: work in recovery mode, i.e. tries to read no Well Formed
|
||||||
* documents
|
* documents
|
||||||
|
* @data: the userdata
|
||||||
*
|
*
|
||||||
* parse an XML file and build a tree. Automatic support for ZLIB/Compress
|
* parse an XML file and build a tree. Automatic support for ZLIB/Compress
|
||||||
* compressed document is provided by default if found at compile-time.
|
* compressed document is provided by default if found at compile-time.
|
||||||
* It use the given SAX function block to handle the parsing callback.
|
* It use the given SAX function block to handle the parsing callback.
|
||||||
* If sax is NULL, fallback to the default DOM tree building routines.
|
* 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
|
* Returns the resulting document tree
|
||||||
*/
|
*/
|
||||||
|
|
||||||
xmlDocPtr
|
xmlDocPtr
|
||||||
xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
|
xmlSAXParseFileWithData(xmlSAXHandlerPtr sax, const char *filename,
|
||||||
int recovery) {
|
int recovery, void *data) {
|
||||||
xmlDocPtr ret;
|
xmlDocPtr ret;
|
||||||
xmlParserCtxtPtr ctxt;
|
xmlParserCtxtPtr ctxt;
|
||||||
char *directory = NULL;
|
char *directory = NULL;
|
||||||
@ -9756,6 +9760,9 @@ xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
|
|||||||
xmlFree(ctxt->sax);
|
xmlFree(ctxt->sax);
|
||||||
ctxt->sax = sax;
|
ctxt->sax = sax;
|
||||||
}
|
}
|
||||||
|
if (data!=NULL) {
|
||||||
|
ctxt->_private=data;
|
||||||
|
}
|
||||||
|
|
||||||
if ((ctxt->directory == NULL) && (directory == NULL))
|
if ((ctxt->directory == NULL) && (directory == NULL))
|
||||||
directory = xmlParserGetDirectory(filename);
|
directory = xmlParserGetDirectory(filename);
|
||||||
@ -9777,6 +9784,27 @@ xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename,
|
|||||||
return(ret);
|
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:
|
* xmlRecoverDoc:
|
||||||
* @cur: a pointer to an array of xmlChar
|
* @cur: a pointer to an array of xmlChar
|
||||||
|
@ -290,6 +290,7 @@ EXPORTS
|
|||||||
xmlSAXUserParseMemory
|
xmlSAXUserParseMemory
|
||||||
xmlSAXParseMemory
|
xmlSAXParseMemory
|
||||||
xmlSAXParseFile
|
xmlSAXParseFile
|
||||||
|
xmlSAXParseFileWithData
|
||||||
xmlSAXParseEntity
|
xmlSAXParseEntity
|
||||||
xmlParseEntity
|
xmlParseEntity
|
||||||
xmlParseDTD
|
xmlParseDTD
|
||||||
|
Reference in New Issue
Block a user