diff options
author | Christian Stocker <chregu@php.net> | 2003-11-29 13:07:20 +0000 |
---|---|---|
committer | Christian Stocker <chregu@php.net> | 2003-11-29 13:07:20 +0000 |
commit | d699569f5ad8bb56f31a36e2c65bf1577cf9e153 (patch) | |
tree | 58b225c48384bdd51c072fe3bf1d72fc7f383461 /ext/xsl/php_xsl.c | |
parent | 647741c8d0b3416e72a080e027e0042632379e7f (diff) | |
download | php-git-d699569f5ad8bb56f31a36e2c65bf1577cf9e153.tar.gz |
it's now possible to return a DomNode from userland functions back to the xsl-processor
Diffstat (limited to 'ext/xsl/php_xsl.c')
-rw-r--r-- | ext/xsl/php_xsl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index 1661a5930f..49af31417d 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -256,7 +256,14 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t 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 @@ PHP_MSHUTDOWN_FUNCTION(xsl) UNREGISTER_INI_ENTRIES(); */ xsltCleanupGlobals(); + //xmlMemoryDump(); return SUCCESS; } |