1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-04 08:02:34 +03:00

applied patch from Ross Reedstrom, Brian West and Stefan Anca to add

* python/libxml.py python/types.c: applied patch from Ross Reedstrom,
  Brian West and Stefan Anca to add XPointer suport to the Python bindings
Daniel
This commit is contained in:
Daniel Veillard
2006-10-10 08:40:04 +00:00
parent 681e904e37
commit 46459066c5
3 changed files with 113 additions and 3 deletions

View File

@ -552,10 +552,17 @@ def nodeWrap(o):
return xmlNode(_obj=o)
def xpathObjectRet(o):
if type(o) == type([]) or type(o) == type(()):
ret = map(lambda x: nodeWrap(x), o)
otype = type(o)
if otype == type([]):
ret = map(xpathObjectRet, o)
return ret
return o
elif otype == type(()):
ret = map(xpathObjectRet, o)
return tuple(ret)
elif otype == type('') or otype == type(0) or otype == type(0.0):
return o
else:
return nodeWrap(o)
#
# register an XPath function