1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-06-24 01:41:40 +03:00

tried to fix the problems reported in bug #126735 fixed again some problem

* python/libxml.py: tried to fix the problems reported in
  bug #126735
* xpath.c SAX2.c error.c parser.c valid.c include/libxml/xmlerror.h:
  fixed again some problem trying to use the structured error
  handlers, c.f. bug #126735
* result/VC/ElementValid: tiny change due to the fix
Daniel
This commit is contained in:
Daniel Veillard
2003-12-08 10:25:02 +00:00
parent fded7bf91b
commit f88d8cf9f1
9 changed files with 83 additions and 39 deletions

View File

@ -362,21 +362,25 @@ class xmlCore:
ctxt.xpathFreeContext()
return res
#
# Selecting nodes using XPath, faster because the context
# is allocated just once per xmlDoc.
#
# #
# # Selecting nodes using XPath, faster because the context
# # is allocated just once per xmlDoc.
# #
# # Removed: DV memleaks c.f. #126735
# #
# def xpathEval2(self, expr):
# doc = self.doc
# if doc == None:
# return None
# try:
# doc._ctxt.setContextNode(self)
# except:
# doc._ctxt = doc.xpathNewContext()
# doc._ctxt.setContextNode(self)
# res = doc._ctxt.xpathEval(expr)
# return res
def xpathEval2(self, expr):
doc = self.doc
if doc == None:
return None
try:
doc._ctxt.setContextNode(self)
except:
doc._ctxt = doc.xpathNewContext()
doc._ctxt.setContextNode(self)
res = doc._ctxt.xpathEval(expr)
return res
return self.xpathEval(expr)
# support for python2 iterators
def walk_depth_first(self):
@ -390,7 +394,7 @@ class xmlCore:
self.doc._ctxt.xpathFreeContext()
except:
pass
libxml2mod.freeDoc(self._o)
libxml2mod.xmlFreeDoc(self._o)
#