]> granicus.if.org Git - php/commitdiff
@ - Added $DomDocument->xinclude() for substitution of XIncludes in
authorChristian Stocker <chregu@php.net>
Mon, 12 Aug 2002 13:11:50 +0000 (13:11 +0000)
committerChristian Stocker <chregu@php.net>
Mon, 12 Aug 2002 13:11:50 +0000 (13:11 +0000)
    a DomDocument (chregu)

ext/domxml/php_domxml.c
ext/domxml/php_domxml.h

index 63893328de2fa3978b3052cb7e6145d921a37418..3e6e4a008565d2f13342905d3374825e4d4ff2a4 100644 (file)
@@ -284,6 +284,7 @@ static zend_function_entry domxml_functions[] = {
        PHP_FALIAS(new_xmldoc,                          domxml_new_xmldoc,                              NULL)
        PHP_FALIAS(domxml_dumpmem,                      domxml_dump_mem,                                NULL)
        PHP_FE(domxml_doc_validate,                                                                                     second_args_force_ref)
+       PHP_FE(domxml_doc_xinclude,                                                                                     NULL)
        {NULL, NULL, NULL}
 };
 
@@ -325,6 +326,7 @@ static function_entry php_domxmldoc_class_functions[] = {
        PHP_FALIAS(xptr_new_context,            xptr_new_context,                               NULL)
 #endif
        PHP_FALIAS(validate,                            domxml_doc_validate,                            first_args_force_ref)
+       PHP_FALIAS(xinclude,                            domxml_doc_xinclude,                            NULL)
 
        {NULL, NULL, NULL}
 };
@@ -4785,6 +4787,27 @@ PHP_FUNCTION(domxml_version)
 }
 /* }}} */
 
+/* {{{ proto int domxml_doc_xinclude()
+   Substitutues xincludes in a DomDocument */
+PHP_FUNCTION(domxml_doc_xinclude)
+{
+       zval *id;
+       xmlDoc *docp;
+       int err; 
+       
+       DOMXML_PARAM_NONE(docp, id, le_domxmldocp);
+       
+       err = xmlXIncludeProcess (docp);
+       
+       if (err) {
+               RETVAL_LONG(err);
+       } else {
+               RETVAL_FALSE;
+       }
+    
+}
+/* }}} */
+
 #if HAVE_DOMXSLT
 static zval *php_xsltstylesheet_new(xsltStylesheetPtr obj, int *found TSRMLS_DC)
 {
index 62f4e4722be527da44ec2a7b34108aea75b7c54e..5cde9277c699413f9189d6f94c72055758fae69a 100644 (file)
@@ -105,6 +105,7 @@ PHP_FUNCTION(domxml_dump_mem);
 PHP_FUNCTION(domxml_dump_mem_file);
 PHP_FUNCTION(domxml_dump_node);
 PHP_FUNCTION(domxml_doc_validate);
+PHP_FUNCTION(domxml_doc_xinclude);
 #if defined(LIBXML_HTML_ENABLED)
 PHP_FUNCTION(domxml_html_dump_mem);
 #endif