diff --git a/ChangeLog b/ChangeLog index 961a4fb5..a0098c57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jun 18 18:44:56 EDT 2006 Daniel Veillard + + * python/types.c: patch from Nic Ferrier to provide a better type + mapping from XPath to python + Sun Jun 18 18:35:50 EDT 2006 Daniel Veillard * runtest.c: applied patch from Boz for VMS and reporting diff --git a/python/types.c b/python/types.c index 8a6a9a0e..6bcbcf69 100644 --- a/python/types.c +++ b/python/types.c @@ -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;