cvs: php4 /ext/domxml php_domxml.c
| From: | Christian Stocker | Date: | Fri, 10 May 2002 14:59:15 +0000 |
| Subject: | cvs: php4 /ext/domxml php_domxml.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11807@lists.php.net to get a copy of this message | ||
chregu Fri May 10 10:59:15 2002 EDT
Modified files:
/php4/ext/domxml php_domxml.c
Log:
@- added fifth optional parameter to domxml_xslt_process. If set,
it will output profiling information to the file stated (chregu)
- introduced version numbering for this extension
Index: php4/ext/domxml/php_domxml.c
diff -u php4/ext/domxml/php_domxml.c:1.149 php4/ext/domxml/php_domxml.c:1.150
--- php4/ext/domxml/php_domxml.c:1.149 Fri May 3 09:53:45 2002
+++ php4/ext/domxml/php_domxml.c Fri May 10 10:59:14 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_domxml.c,v 1.149 2002/05/03 13:53:45 chregu Exp $ */
+/* $Id: php_domxml.c,v 1.150 2002/05/10 14:59:14 chregu Exp $ */
/* TODO
* - Support Notation Nodes
@@ -455,7 +455,7 @@
PHP_RINIT(domxml),
NULL,
PHP_MINFO(domxml),
- NO_VERSION_YET,
+ "20020510", //Extension versionnumber
STANDARD_MODULE_PROPERTIES
};
@@ -4257,7 +4257,7 @@
return params;
}
-/* {{{ proto object domxml_xslt_process(object xslstylesheet, object xmldoc [, array
xslt_parameters [, bool xpath_parameters]])
+/* {{{ proto object domxml_xslt_process(object xslstylesheet, object xmldoc [, array
xslt_parameters [, bool xpath_parameters [, string profileFilename]]])
Perform an XSLT transformation */
PHP_FUNCTION(domxml_xslt_process)
{
@@ -4273,6 +4273,8 @@
xmlDocPtr docp;
char **params = NULL;
int ret;
+ char *filename;
+ int filename_len = 0;
DOMXML_GET_THIS(idxsl);
@@ -4283,7 +4285,7 @@
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|ab", &idxml, &idparams,
&xpath_params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|abs", &idxml, &idparams,
&xpath_params, &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
@@ -4293,7 +4295,14 @@
params = php_domxslt_make_params(idparams, xpath_params TSRMLS_CC);
}
- docp = xsltApplyStylesheet(xsltstp, xmldocp, (const char**)params);
+ if (filename_len) {
+ FILE *f;
+ f = fopen (filename,"w");
+ docp = xsltProfileStylesheet(xsltstp, xmldocp, (const char**)params, f);
+ fclose(f);
+ } else {
+ docp = xsltApplyStylesheet(xsltstp, xmldocp, (const char**)params);
+ }
if (params) {
efree(params);