fix float and boolean XPath conversions try to fix Stephane Bidoul attempt
authorDaniel Veillard <veillard@src.gnome.org>
Wed, 19 Jul 2006 19:04:52 +0000 (19:04 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Wed, 19 Jul 2006 19:04:52 +0000 (19:04 +0000)
* python/types.c: fix float and boolean XPath conversions
* libxslt/xsltutils.c: try to fix Stephane Bidoul attempt
  at setting XInclude support.
Daniel

ChangeLog
libxslt/xsltutils.c
python/types.c

index 9340fc7..502b24f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jul 19 15:06:39 EDT 2006 Daniel Veillard <daniel@veillard.com>
+
+       * 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 <wbrack@mmm.com.hk>
 
        * Updated tests affected by recent library changes -
index bc27ef6..ea75c6a 100644 (file)
@@ -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);
 }
 
index 53bdd5c..6416354 100644 (file)
@@ -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;