mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-10-26 12:25:09 +03:00
try to fix xmlParseInNodeContext when operating on an HTML document.
* HTMLparser.c libxml.h parser.c: try to fix xmlParseInNodeContext when operating on an HTML document. Daniel
This commit is contained in:
parent
a930fbec6b
commit
499cc9204f
@ -1,3 +1,8 @@
|
|||||||
|
Wed Jan 18 18:21:15 CET 2006 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* HTMLparser.c libxml.h parser.c: try to fix xmlParseInNodeContext
|
||||||
|
when operating on an HTML document.
|
||||||
|
|
||||||
Mon Jan 9 17:27:15 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
|
Mon Jan 9 17:27:15 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
|
||||||
|
|
||||||
* relaxng.c include/libxml/relaxng.h: Added
|
* relaxng.c include/libxml/relaxng.h: Added
|
||||||
|
15
HTMLparser.c
15
HTMLparser.c
@ -3753,10 +3753,8 @@ htmlParseReference(htmlParserCtxtPtr ctxt) {
|
|||||||
/**
|
/**
|
||||||
* htmlParseContent:
|
* htmlParseContent:
|
||||||
* @ctxt: an HTML parser context
|
* @ctxt: an HTML parser context
|
||||||
* @name: the node name
|
|
||||||
*
|
*
|
||||||
* Parse a content: comment, sub-element, reference or text.
|
* Parse a content: comment, sub-element, reference or text.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3874,6 +3872,19 @@ htmlParseContent(htmlParserCtxtPtr ctxt) {
|
|||||||
if (currentNode != NULL) xmlFree(currentNode);
|
if (currentNode != NULL) xmlFree(currentNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* htmlParseContent:
|
||||||
|
* @ctxt: an HTML parser context
|
||||||
|
*
|
||||||
|
* Parse a content: comment, sub-element, reference or text.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
__htmlParseContent(void *ctxt) {
|
||||||
|
if (ctxt != NULL)
|
||||||
|
htmlParseContent((htmlParserCtxtPtr) ctxt);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* htmlParseElement:
|
* htmlParseElement:
|
||||||
* @ctxt: an HTML parser context
|
* @ctxt: an HTML parser context
|
||||||
|
8
libxml.h
8
libxml.h
@ -49,6 +49,14 @@ extern int __xmlRegisterCallbacks;
|
|||||||
*/
|
*/
|
||||||
void __xmlIOErr(int domain, int code, const char *extra);
|
void __xmlIOErr(int domain, int code, const char *extra);
|
||||||
void __xmlLoaderErr(void *ctx, const char *msg, const char *filename);
|
void __xmlLoaderErr(void *ctx, const char *msg, const char *filename);
|
||||||
|
#ifdef LIBXML_HTML_ENABLED
|
||||||
|
/*
|
||||||
|
* internal function of HTML parser needed for xmlParseInNodeContext
|
||||||
|
* but not part of the API
|
||||||
|
*/
|
||||||
|
void __htmlParseContent(void *ctx);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef IN_LIBXML
|
#ifdef IN_LIBXML
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
8
parser.c
8
parser.c
@ -11709,7 +11709,13 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen,
|
|||||||
ctxt->loadsubset |= XML_SKIP_IDS;
|
ctxt->loadsubset |= XML_SKIP_IDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlParseContent(ctxt);
|
#ifdef LIBXML_HTML_ENABLED
|
||||||
|
if (doc->type == XML_HTML_DOCUMENT_NODE)
|
||||||
|
__htmlParseContent(ctxt);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
xmlParseContent(ctxt);
|
||||||
|
|
||||||
nsPop(ctxt, nsnr);
|
nsPop(ctxt, nsnr);
|
||||||
if ((RAW == '<') && (NXT(1) == '/')) {
|
if ((RAW == '<') && (NXT(1) == '/')) {
|
||||||
xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
|
xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user