cvs: php4 /ext/domxml config.m4 php_domxml.c php_domxml.h
| From: | Christian Stocker | Date: | Thu, 22 Aug 2002 15:02:43 +0000 |
| Subject: | cvs: php4 /ext/domxml config.m4 php_domxml.c php_domxml.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13570@lists.php.net to get a copy of this message | ||
chregu Thu Aug 22 11:02:43 2002 EDT
Modified files:
/php4/ext/domxml php_domxml.c php_domxml.h config.m4
Log:
@- Added XsltObject->dump_mem($result) for returning xslt-result directly
@ into a string (morus.walter@web.de, chregu)
- XsltObject->dump_file() will follow
- bumped up needed libxslt version to 1.0.18
Index: php4/ext/domxml/php_domxml.c
diff -u php4/ext/domxml/php_domxml.c:1.199 php4/ext/domxml/php_domxml.c:1.200
--- php4/ext/domxml/php_domxml.c:1.199 Thu Aug 22 10:32:43 2002
+++ php4/ext/domxml/php_domxml.c Thu Aug 22 11:02:41 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_domxml.c,v 1.199 2002/08/22 14:32:43 chregu Exp $ */
+/* $Id: php_domxml.c,v 1.200 2002/08/22 15:02:41 chregu Exp $ */
/* TODO
* - Support Notation Nodes
@@ -282,6 +282,7 @@
PHP_FE(domxml_xslt_stylesheet_doc, NULL)
PHP_FE(domxml_xslt_stylesheet_file, NULL)
PHP_FE(domxml_xslt_process, NULL)
+ PHP_FE(domxml_xslt_dump_mem, NULL)
#endif
PHP_FALIAS(domxml_add_root, domxml_doc_add_root, NULL)
@@ -521,6 +522,7 @@
static zend_function_entry php_domxsltstylesheet_class_functions[] = {
/* TODO: maybe some more methods? */
PHP_FALIAS(process, domxml_xslt_process, NULL)
+ PHP_FALIAS(dump_mem, domxml_xslt_dump_mem, NULL)
{NULL, NULL, NULL}
};
#endif
@@ -4172,6 +4174,43 @@
}
/* }}} */
+/* {{{ proto string domxml_xslt_dump_mem(object xslstylesheet, object xmldoc)
+ output XSLT result to memory */
+PHP_FUNCTION(domxml_xslt_dump_mem)
+{
+ zval *rv, *idxsl, *idxml;
+ xsltStylesheetPtr xsltstp;
+ xmlDocPtr xmldocp;
+ xmlDocPtr docp;
+ xmlChar *doc_txt_ptr;
+ int doc_txt_len;
+ int ret;
+
+ DOMXML_GET_THIS(idxsl);
+
+ xsltstp = php_xsltstylesheet_get_object(idxsl, le_domxsltstylesheetp, 0 TSRMLS_CC);
+ if (!xsltstp) {
+ php_error(E_WARNING, "%s(): underlying object missing",
+ get_active_function_name(TSRMLS_C));
+ RETURN_FALSE;
+ }
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &idxml) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ DOMXML_GET_OBJ(xmldocp, idxml, le_domxmldocp);
+
+ ret = xsltSaveResultToString(&doc_txt_ptr, &doc_txt_len, xmldocp, xsltstp);
+
+ if (ret) {
+ RETURN_FALSE;
+ }
+
+ RETURN_STRINGL(doc_txt_ptr, doc_txt_len, 1);
+}
+/* }}} */
+
/* {{{ proto object domxml_parser([string buf[,string filename]])
Creates new xmlparser */
PHP_FUNCTION(domxml_parser)
@@ -4902,7 +4941,7 @@
Get XML library version */
PHP_FUNCTION(domxml_version)
{
- RETURN_STRING(xmlParserVersion,1);
+ RETURN_STRING((char *) xmlParserVersion,1);
}
/* }}} */
Index: php4/ext/domxml/php_domxml.h
diff -u php4/ext/domxml/php_domxml.h:1.69 php4/ext/domxml/php_domxml.h:1.70
--- php4/ext/domxml/php_domxml.h:1.69 Thu Aug 15 14:02:25 2002
+++ php4/ext/domxml/php_domxml.h Thu Aug 22 11:02:41 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_domxml.h,v 1.69 2002/08/15 18:02:25 chregu Exp $ */
+/* $Id: php_domxml.h,v 1.70 2002/08/22 15:02:41 chregu Exp $ */
#ifndef PHP_DOMXML_H
#define PHP_DOMXML_H
@@ -229,6 +229,7 @@
PHP_FUNCTION(domxml_xslt_stylesheet_doc);
PHP_FUNCTION(domxml_xslt_stylesheet_file);
PHP_FUNCTION(domxml_xslt_process);
+PHP_FUNCTION(domxml_xslt_dump_mem);
PHP_FUNCTION(domxml_xslt_version);
#endif
typedef struct {
Index: php4/ext/domxml/config.m4
diff -u php4/ext/domxml/config.m4:1.39 php4/ext/domxml/config.m4:1.40
--- php4/ext/domxml/config.m4:1.39 Sat Jun 1 16:14:57 2002
+++ php4/ext/domxml/config.m4 Thu Aug 22 11:02:41 2002
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.39 2002/06/01 20:14:57 sr Exp $
+dnl $Id: config.m4,v 1.40 2002/08/22 15:02:41 chregu Exp $
dnl
AC_DEFUN(PHP_DOM_CHECK_VERSION,[
@@ -79,13 +79,13 @@
AC_MSG_CHECKING(for libxslt version)
AC_EGREP_CPP(yes,[
#include <libxslt/xsltconfig.h>
-#if LIBXSLT_VERSION >= 10003
+#if LIBXSLT_VERSION >= 10018
yes
#endif
],[
- AC_MSG_RESULT(>= 1.0.3)
+ AC_MSG_RESULT(>= 1.0.18)
],[
- AC_MSG_ERROR(libxslt version 1.0.3 or greater required.)
+ AC_MSG_ERROR(libxslt version 1.0.18 or greater required.)
])
CPPFLAGS=$old_CPPFLAGS
])
@@ -108,11 +108,11 @@
])
PHP_ARG_WITH(dom-xslt, for DOM XSLT support,
-[ --with-dom-xslt[=DIR] Include DOM XSLT support (requires libxslt >= 1.0.3).
+[ --with-dom-xslt[=DIR] Include DOM XSLT support (requires libxslt >= 1.0.18).
DIR is the libxslt install directory.])
PHP_ARG_WITH(dom-exslt, for DOM EXSLT support,
-[ --with-dom-exslt[=DIR] Include DOM EXSLT support (requires libxslt >= 1.0.3).
+[ --with-dom-exslt[=DIR] Include DOM EXSLT support (requires libxslt >= 1.0.18).
DIR is the libexslt install directory.])
if test "$PHP_DOM_XSLT" != "no"; then