From d3eaa2f845be6465a891dcf3ecacf934d82f833e Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 19 Jul 2006 19:04:52 +0000 Subject: [PATCH] fix float and boolean XPath conversions try to fix Stephane Bidoul attempt * python/types.c: fix float and boolean XPath conversions * libxslt/xsltutils.c: try to fix Stephane Bidoul attempt at setting XInclude support. Daniel --- ChangeLog | 6 ++++++ libxslt/xsltutils.c | 6 ++++++ python/types.c | 13 +++++++++++++ 3 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9340fc7..502b24f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Jul 19 15:06:39 EDT 2006 Daniel Veillard + + * python/types.c: fix float and boolean XPath conversions + * libxslt/xsltutils.c: try to fix Stephane Bidoul attempt + at setting XInclude support. + Mon Jul 17 11:15:23 PDT 2006 William Brack * Updated tests affected by recent library changes - diff --git a/libxslt/xsltutils.c b/libxslt/xsltutils.c index bc27ef6..ea75c6a 100644 --- a/libxslt/xsltutils.c +++ b/libxslt/xsltutils.c @@ -1383,7 +1383,13 @@ xsltSetCtxtParseOptions(xsltTransformContextPtr ctxt, int options) if (ctxt == NULL) return(-1); oldopts = ctxt->parserOptions; + if (ctxt->xinclude) + oldopts |= XML_PARSE_XINCLUDE; ctxt->parserOptions = options; + if (options & XML_PARSE_XINCLUDE) + ctxt->xinclude = 1; + else + ctxt->xinclude = 0; return(oldopts); } diff --git a/python/types.c b/python/types.c index 53bdd5c..6416354 100644 --- a/python/types.c +++ b/python/types.c @@ -425,6 +425,19 @@ 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; -- 2.7.4