mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
adding repeated parsing and validating tests make the new DOM tree
* Makefile.am: adding repeated parsing and validating tests * SAX2.c parser.c tree.c include/libxml/parser.h: make the new DOM tree building interfaces use the dictionary from the parsing context to build the element and attributes names as well as formatting spaces and short text nodes * include/libxml/dict.h dict.c: added some reference counting for xmlDictPtr because they can be shared by documents and a parser context. * xmlreader.c: a bit of cleanup, remove the specific tree freeing functions and use the standard ones now. * xmllint.c: add --nodict * python/libxml.c: fix a stupid bug so that ns() works on attribute nodes. Daniel
This commit is contained in:
13
xmlreader.c
13
xmlreader.c
@ -1246,7 +1246,7 @@ get_next_node:
|
||||
(reader->node->prev->type != XML_DTD_NODE)) {
|
||||
xmlNodePtr tmp = reader->node->prev;
|
||||
xmlUnlinkNode(tmp);
|
||||
xmlTextReaderFreeNode(reader, tmp);
|
||||
xmlFreeNode(tmp);
|
||||
}
|
||||
|
||||
goto node_found;
|
||||
@ -1279,7 +1279,7 @@ get_next_node:
|
||||
*/
|
||||
if (oldnode->type != XML_DTD_NODE) {
|
||||
xmlUnlinkNode(oldnode);
|
||||
xmlTextReaderFreeNode(reader, oldnode);
|
||||
xmlFreeNode(oldnode);
|
||||
}
|
||||
|
||||
goto node_end;
|
||||
@ -1677,16 +1677,17 @@ xmlFreeTextReader(xmlTextReaderPtr reader) {
|
||||
}
|
||||
#endif
|
||||
if (reader->ctxt != NULL) {
|
||||
if (reader->ctxt->myDoc != NULL) {
|
||||
xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
|
||||
reader->ctxt->myDoc = NULL;
|
||||
}
|
||||
if ((reader->ctxt->vctxt.vstateTab != NULL) &&
|
||||
(reader->ctxt->vctxt.vstateMax > 0)){
|
||||
xmlFree(reader->ctxt->vctxt.vstateTab);
|
||||
reader->ctxt->vctxt.vstateTab = 0;
|
||||
reader->ctxt->vctxt.vstateMax = 0;
|
||||
}
|
||||
if (reader->ctxt->myDoc != NULL) {
|
||||
xmlFreeDoc(reader->ctxt->myDoc);
|
||||
reader->ctxt->myDoc = NULL;
|
||||
}
|
||||
reader->ctxt->dict = NULL;
|
||||
if (reader->allocs & XML_TEXTREADER_CTXT)
|
||||
xmlFreeParserCtxt(reader->ctxt);
|
||||
}
|
||||
|
Reference in New Issue
Block a user