1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-27 18:50:07 +03:00

applied patch from Mark Vadoc to not use SAX1 unless necessary. Daniel

* HTMLparser.c relaxng.c testRelax.c testSchemas.c: applied
  patch from Mark Vadoc to not use SAX1 unless necessary.
Daniel
This commit is contained in:
Daniel Veillard 2004-01-13 20:42:02 +00:00
parent c82c57e69c
commit 87247e8740
6 changed files with 16 additions and 9 deletions

View File

@ -1,3 +1,8 @@
Tue Jan 13 21:39:58 CET 2004 Daniel Veillard <daniel@veillard.com>
* HTMLparser.c relaxng.c testRelax.c testSchemas.c: applied
patch from Mark Vadoc to not use SAX1 unless necessary.
Mon Jan 12 17:22:57 CET 2004 Daniel Veillard <daniel@veillard.com>
* dict.c parser.c xmlstring.c: some parser optimizations,

View File

@ -5173,9 +5173,11 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding)
}
canonicFilename = (char *) xmlCanonicPath((const xmlChar *) filename);
if (canonicFilename == NULL) {
#ifdef LIBXML_SAX1_ENABLED
if (xmlDefaultSAXHandler.error != NULL) {
xmlDefaultSAXHandler.error(NULL, "out of memory\n");
}
#endif
xmlFreeParserCtxt(ctxt);
return(NULL);
}

View File

@ -162,7 +162,7 @@ register_namespaces(xmlXPathContextPtr xpathCtx, const xmlChar* nsList) {
next = (xmlChar*)xmlStrchr(next, '=');
if(next == NULL) {
fprintf(stderr,"Error: invalid namespaces list format\n");
free(nsListDup);
xmlFree(nsListDup);
return(-1);
}
*(next++) = '\0';
@ -177,12 +177,12 @@ register_namespaces(xmlXPathContextPtr xpathCtx, const xmlChar* nsList) {
/* do register namespace */
if(xmlXPathRegisterNs(xpathCtx, prefix, href) != 0) {
fprintf(stderr,"Error: unable to register NS with prefix=\"%s\" and href=\"%s\"\n", prefix, href);
free(nsListDup);
xmlFree(nsListDup);
return(-1);
}
}
free(nsListDup);
xmlFree(nsListDup);
return(0);
}

View File

@ -1569,7 +1569,7 @@ xmlRelaxNGLoadInclude(xmlRelaxNGParserCtxtPtr ctxt, const xmlChar * URL,
/*
* load the document
*/
doc = xmlParseFile((const char *) URL);
doc = xmlReadFile((const char *) URL,NULL,0);
if (doc == NULL) {
xmlRngPErr(ctxt, node, XML_RNGP_PARSE_ERROR,
"xmlRelaxNG: could not load %s\n", URL, NULL);
@ -1901,7 +1901,7 @@ xmlRelaxNGLoadExternalRef(xmlRelaxNGParserCtxtPtr ctxt,
/*
* load the document
*/
doc = xmlParseFile((const char *) URL);
doc = xmlReadFile((const char *) URL,NULL,0);
if (doc == NULL) {
xmlRngPErr(ctxt, NULL, XML_RNGP_PARSE_ERROR,
"xmlRelaxNG: could not load %s\n", URL, NULL);
@ -7240,7 +7240,7 @@ xmlRelaxNGParse(xmlRelaxNGParserCtxtPtr ctxt)
* First step is to parse the input document into an DOM/Infoset
*/
if (ctxt->URL != NULL) {
doc = xmlParseFile((const char *) ctxt->URL);
doc = xmlReadFile((const char *) ctxt->URL,NULL,0);
if (doc == NULL) {
xmlRngPErr(ctxt, NULL, XML_RNGP_PARSE_ERROR,
"xmlRelaxNGParse: could not load %s\n", ctxt->URL,
@ -7248,7 +7248,7 @@ xmlRelaxNGParse(xmlRelaxNGParserCtxtPtr ctxt)
return (NULL);
}
} else if (ctxt->buffer != NULL) {
doc = xmlParseMemory(ctxt->buffer, ctxt->size);
doc = xmlReadMemory(ctxt->buffer, ctxt->size,NULL,NULL,0);
if (doc == NULL) {
xmlRngPErr(ctxt, NULL, XML_RNGP_PARSE_ERROR,
"xmlRelaxNGParse: could not parse schemas\n", NULL,

View File

@ -134,7 +134,7 @@ int main(int argc, char **argv) {
} else {
xmlDocPtr doc;
doc = xmlParseFile(argv[i]);
doc = xmlReadFile(argv[i],NULL,0);
if (doc == NULL) {
fprintf(stderr, "Could not parse %s\n", argv[i]);

View File

@ -125,7 +125,7 @@ int main(int argc, char **argv) {
} else {
xmlDocPtr doc;
doc = xmlParseFile(argv[i]);
doc = xmlReadFile(argv[i],NULL,0);
if (doc == NULL) {
fprintf(stderr, "Could not parse %s\n", argv[i]);