1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-20 03:52:25 +03:00

patch from Nic Ferrier to provide a better type mapping from XPath to

* python/types.c: patch from Nic Ferrier to provide a better type
  mapping from XPath to python
Daniel
This commit is contained in:
Daniel Veillard
2006-06-18 17:40:53 +00:00
parent 381ff364dc
commit a4bd369232
2 changed files with 19 additions and 0 deletions

View File

@@ -422,6 +422,20 @@ libxml_xmlXPathObjectPtrConvert(PyObject * obj)
if PyFloat_Check
(obj) {
ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
} else if PyInt_Check(obj) {
ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
} else if PyBool_Check (obj) {
if (obj == Py_True) {
ret = xmlXPathNewBoolean(1);
}
else {
ret = xmlXPathNewBoolean(0);
}
} else if PyString_Check
(obj) {
xmlChar *str;