diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2006-06-18 17:40:53 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2006-06-18 17:40:53 +0000 |
commit | a4bd369232f700aed90da69520d9ea7c9098a935 (patch) | |
tree | 06623d6f3e4a652eba42d92b17a91e551991004c /python | |
parent | 381ff364dc6deacdf18606c0196a9e913cf76a87 (diff) | |
download | libxml2-a4bd369232f700aed90da69520d9ea7c9098a935.tar.gz |
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
Diffstat (limited to 'python')
-rw-r--r-- | python/types.c | 14 |
1 files changed, 14 insertions, 0 deletions
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; |