chregu          Sat Nov 29 08:07:21 2003 EDT

  Modified files:              
    /php-src/ext/xsl    php_xsl.c 
  Log:
  it's now possible to return a DomNode from userland functions back to the 
xsl-processor
  
  
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.10 php-src/ext/xsl/php_xsl.c:1.11
--- php-src/ext/xsl/php_xsl.c:1.10      Fri Nov 28 17:08:13 2003
+++ php-src/ext/xsl/php_xsl.c   Sat Nov 29 08:07:20 2003
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_xsl.c,v 1.10 2003/11/28 22:08:13 chregu Exp $ */
+/* $Id: php_xsl.c,v 1.11 2003/11/29 13:07:20 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -256,7 +256,14 @@
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call 
handler %s()", Z_STRVAL_P(&handler));
                } 
        } else {
-               if (retval->type == IS_BOOL) {
+               if (retval->type == IS_OBJECT && instanceof_function( 
Z_OBJCE_P(retval), dom_node_class_entry)) {
+                       xmlNode *nodep;
+                       dom_object *obj;
+                       obj = (dom_object *)zend_object_store_get_object(retval 
TSRMLS_CC);
+                       nodep = dom_object_get_node(obj);
+                       valuePush(ctxt, xmlXPathNewNodeSet(nodep));
+               }
+               else if (retval->type == IS_BOOL) {
                        valuePush(ctxt, xmlXPathNewBoolean(retval->value.lval));
                } else {
                        convert_to_string_ex(&retval);
@@ -362,6 +369,7 @@
        UNREGISTER_INI_ENTRIES();
        */
        xsltCleanupGlobals();
+       //xmlMemoryDump();
 
        return SUCCESS;
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to