summaryrefslogtreecommitdiff
path: root/ext/xsl
diff options
context:
space:
mode:
Diffstat (limited to 'ext/xsl')
-rw-r--r--ext/xsl/CREDITS2
-rw-r--r--ext/xsl/EXPERIMENTAL5
-rw-r--r--ext/xsl/config.m462
-rw-r--r--ext/xsl/config.w3235
-rw-r--r--ext/xsl/php_xsl.c294
-rw-r--r--ext/xsl/php_xsl.h122
-rw-r--r--ext/xsl/tests/area_list.xsl10
-rw-r--r--ext/xsl/tests/area_name.xml12
-rw-r--r--ext/xsl/tests/bug26384.phpt33
-rw-r--r--ext/xsl/tests/documentxpath.xsl10
-rw-r--r--ext/xsl/tests/exslt.xml10
-rw-r--r--ext/xsl/tests/exslt.xsl46
-rw-r--r--ext/xsl/tests/prepare.inc20
-rw-r--r--ext/xsl/tests/skipif.inc1
-rw-r--r--ext/xsl/tests/streamsinclude.xsl6
-rw-r--r--ext/xsl/tests/xslt.xml28
-rw-r--r--ext/xsl/tests/xslt.xsl26
-rw-r--r--ext/xsl/tests/xslt.xsl.gzbin395 -> 0 bytes
-rw-r--r--ext/xsl/tests/xslt001.phpt22
-rw-r--r--ext/xsl/tests/xslt002.phpt29
-rw-r--r--ext/xsl/tests/xslt003.phpt23
-rw-r--r--ext/xsl/tests/xslt004.phpt29
-rw-r--r--ext/xsl/tests/xslt005.phpt31
-rw-r--r--ext/xsl/tests/xslt006.phpt23
-rw-r--r--ext/xsl/tests/xslt007.phpt24
-rw-r--r--ext/xsl/tests/xslt008.phpt28
-rw-r--r--ext/xsl/tests/xslt009.phpt25
-rw-r--r--ext/xsl/tests/xslt010.phpt112
-rw-r--r--ext/xsl/tests/xslt011.phpt51
-rw-r--r--ext/xsl/tests/xslt011.xml1
-rw-r--r--ext/xsl/tests/xslt011.xsl21
-rw-r--r--ext/xsl/xsl.dsp120
-rw-r--r--ext/xsl/xsl_fe.h36
-rw-r--r--ext/xsl/xsltprocessor.c659
34 files changed, 0 insertions, 1956 deletions
diff --git a/ext/xsl/CREDITS b/ext/xsl/CREDITS
deleted file mode 100644
index 2f33c8874c..0000000000
--- a/ext/xsl/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-XSL
-Christian Stocker, Rob Richards
diff --git a/ext/xsl/EXPERIMENTAL b/ext/xsl/EXPERIMENTAL
deleted file mode 100644
index 293159a693..0000000000
--- a/ext/xsl/EXPERIMENTAL
+++ /dev/null
@@ -1,5 +0,0 @@
-this module is experimental,
-its functions may change their names
-or move to extension all together
-so do not rely to much on them
-you have been warned!
diff --git a/ext/xsl/config.m4 b/ext/xsl/config.m4
deleted file mode 100644
index 13290409ac..0000000000
--- a/ext/xsl/config.m4
+++ /dev/null
@@ -1,62 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-PHP_ARG_WITH(xsl, for XSL support,
-[ --with-xsl[=DIR] Include new XSL support (requires libxslt >= 1.0.18).
- DIR is the libxslt install directory.])
-
-if test "$PHP_XSL" != "no" -a "$PHP_DOM" = "no"; then
- AC_MSG_ERROR([XSL extension requires DOM extension, add --enable-dom.])
-fi
-
-if test "$PHP_XSL" != "no"; then
-
- for i in $PHP_XSL /usr/local /usr; do
- if test -x "$i/bin/xslt-config"; then
- XSLT_CONFIG=$i/bin/xslt-config
- break
- fi
- done
-
- if test -z "$XSLT_CONFIG"; then
- AC_MSG_ERROR([xslt-config not found. Please reinstall the libxslt >= 1.0.18 distribution])
- else
- libxslt_full_version=`$XSLT_CONFIG --version`
- ac_IFS=$IFS
- IFS="."
- set $libxslt_full_version
- IFS=$ac_IFS
- LIBXSLT_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
- if test "$LIBXSLT_VERSION" -ge "1000018"; then
- XSL_LIBS=`$XSLT_CONFIG --libs`
- XSL_INCS=`$XSLT_CONFIG --cflags`
- PHP_EVAL_LIBLINE($XSL_LIBS, XSL_SHARED_LIBADD)
- PHP_EVAL_INCLINE($XSL_INCS)
-
- AC_MSG_CHECKING([for EXSLT support])
- for i in $PHP_XSL /usr/local /usr; do
- if test -r "$i/include/libexslt/exslt.h"; then
- PHP_XSL_EXSL_DIR=$i
- break
- fi
- done
- if test -z "$PHP_XSL_EXSL_DIR"; then
- AC_MSG_RESULT(not found)
- else
- AC_MSG_RESULT(found)
- PHP_ADD_LIBRARY_WITH_PATH(exslt, $PHP_XSL_EXSL_DIR/lib, XSL_SHARED_LIBADD)
- PHP_ADD_INCLUDE($PHP_XSL_EXSL_DIR/include)
- AC_DEFINE(HAVE_XSL_EXSLT,1,[ ])
- fi
- else
- AC_MSG_ERROR([libxslt version 1.0.18 or greater required.])
- fi
-
-
- fi
-
- AC_DEFINE(HAVE_XSL,1,[ ])
- PHP_NEW_EXTENSION(xsl, php_xsl.c xsltprocessor.c, $ext_shared)
- PHP_SUBST(XSL_SHARED_LIBADD)
-fi
diff --git a/ext/xsl/config.w32 b/ext/xsl/config.w32
deleted file mode 100644
index 2a92a7b037..0000000000
--- a/ext/xsl/config.w32
+++ /dev/null
@@ -1,35 +0,0 @@
-// $Id$
-// vim: ft=javascript
-
-ARG_WITH("xsl", "xsl support", "no");
-
-if (PHP_XSL != "no") {
- if (PHP_DOM == "yes" && PHP_LIBXML == "yes") {
- var ext_xsl_lib_found = false;
-
- if (CHECK_LIB("libxslt_a.lib", "xsl", PHP_XSL)) {
- ADD_FLAG("CFLAGS_XSL", "/D LIBXSLT_STATIC ");
- ext_xsl_lib_found = true;
- } else if (CHECK_LIB("libxslt.lib", "xsl", PHP_XSL)) {
- ext_xsl_lib_found = true;
- }
-
- if (ext_xsl_lib_found && CHECK_HEADER_ADD_INCLUDE("libxslt\\xslt.h", "CFLAGS_XSL")) {
-
- EXTENSION("xsl", "php_xsl.c xsltprocessor.c", PHP_XSL_SHARED);
- AC_DEFINE("HAVE_XSL", 1, "Define if xsl extension is enabled");
- if (! PHP_XSL_SHARED) {
- ADD_FLAG("CFLAGS_XSL", "/D DOM_EXPORTS /D LIBXML_STATIC");
- } else {
- if (PHP_DEBUG == "yes") {
- ADD_FLAG("LDFLAGS_XSL", "/nodefaultlib:msvcrt");
- }
- }
- ADD_EXTENSION_DEP('xsl', 'libxml');
- } else {
- WARNING("xsl not enabled; libraries and headers not found");
- }
- } else {
- WARNING("xsl not enabled; DOM extension required");
- }
-}
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
deleted file mode 100644
index 29255c991a..0000000000
--- a/ext/xsl/php_xsl.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Christian Stocker <chregu@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_xsl.h"
-
-
-/* If you declare any globals in php_xsl.h uncomment this:
-ZEND_DECLARE_MODULE_GLOBALS(xsl)
-*/
-
-static zend_object_handlers xsl_object_handlers;
-
-/* {{{ xsl_functions[]
- *
- * Every user visible function must have an entry in xsl_functions[].
- */
-function_entry xsl_functions[] = {
- {NULL, NULL, NULL} /* Must be the last line in xsl_functions[] */
-};
-/* }}} */
-
-/* {{{ xsl_module_entry
- */
-zend_module_entry xsl_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
- STANDARD_MODULE_HEADER,
-#endif
- "xsl",
- xsl_functions,
- PHP_MINIT(xsl),
- PHP_MSHUTDOWN(xsl),
- PHP_RINIT(xsl), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(xsl), /* Replace with NULL if there's nothing to do at request end */
- PHP_MINFO(xsl),
-#if ZEND_MODULE_API_NO >= 20010901
- "0.1", /* Replace with version number for your extension */
-#endif
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-#ifdef COMPILE_DL_XSL
-ZEND_GET_MODULE(xsl)
-#endif
-
-/* {{{ xsl_objects_clone */
-void xsl_objects_clone(void *object, void **object_clone TSRMLS_DC)
-{
- /* TODO */
-}
-/* }}} */
-
-/* {{{ xsl_objects_dtor */
-void xsl_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC)
-{
- xsl_object *intern = (xsl_object *)object;
-
- zend_hash_destroy(intern->std.properties);
- FREE_HASHTABLE(intern->std.properties);
-
- zend_hash_destroy(intern->parameter);
- FREE_HASHTABLE(intern->parameter);
-
- if (intern->ptr) {
- /* free wrapper */
- if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) {
- ((xsltStylesheetPtr) intern->ptr)->_private = NULL;
- }
-
- xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr);
- intern->ptr = NULL;
- }
- efree(object);
-}
-/* }}} */
-/* {{{ xsl_objects_new */
-zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC)
-{
- zend_object_value retval;
- xsl_object *intern;
- zval *tmp;
-
- intern = emalloc(sizeof(xsl_object));
- intern->std.ce = class_type;
- intern->std.in_get = 0;
- intern->std.in_set = 0;
- intern->ptr = NULL;
- intern->prop_handler = NULL;
- intern->parameter = NULL;
- intern->hasKeys = 0;
- intern->registerPhpFunctions = 0;
-
- ALLOC_HASHTABLE(intern->std.properties);
- zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
- zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
- ALLOC_HASHTABLE(intern->parameter);
- zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0);
- retval.handle = zend_objects_store_put(intern, xsl_objects_dtor, xsl_objects_clone TSRMLS_CC);
- intern->handle = retval.handle;
- retval.handlers = &xsl_object_handlers;
- return retval;
-}
-/* }}} */
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(xsl)
-{
-
- zend_class_entry ce;
-
- memcpy(&xsl_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
-
- REGISTER_XSL_CLASS(ce, "xsltprocessor", NULL, php_xsl_xsltprocessor_class_functions, xsl_xsltprocessor_class_entry);
-#if HAVE_XSL_EXSLT
- exsltRegisterAll();
-#endif
-
- REGISTER_LONG_CONSTANT("XSL_CLONE_AUTO", 0, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("XSL_CLONE_NEVER", -1, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("XSL_CLONE_ALWAYS", 1, CONST_CS | CONST_PERSISTENT);
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ xsl_object_get_data */
-zval *xsl_object_get_data(void *obj)
-{
- zval *dom_wrapper;
- dom_wrapper = ((xsltStylesheetPtr) obj)->_private;
- return dom_wrapper;
-}
-/* }}} */
-
-/* {{{ xsl_object_set_data */
-static void xsl_object_set_data(void *obj, zval *wrapper TSRMLS_DC)
-{
- ((xsltStylesheetPtr) obj)->_private = wrapper;
-}
-/* }}} */
-
-/* {{{ php_xsl_set_object */
-void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC)
-{
- xsl_object *object;
-
- object = (xsl_object *)zend_objects_get_address(wrapper TSRMLS_CC);
- object->ptr = obj;
- xsl_object_set_data(obj, wrapper TSRMLS_CC);
-}
-/* }}} */
-
-/* {{{ php_xsl_create_object */
-zval *php_xsl_create_object(xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval *return_value TSRMLS_DC)
-{
- zval *wrapper;
- zend_class_entry *ce;
-
- *found = 0;
-
- if (!obj) {
- if(!wrapper_in) {
- ALLOC_ZVAL(wrapper);
- } else {
- wrapper = wrapper_in;
- }
- ZVAL_NULL(wrapper);
- return wrapper;
- }
-
- if ((wrapper = (zval *) xsl_object_get_data((void *) obj))) {
- zval_add_ref(&wrapper);
- *found = 1;
- return wrapper;
- }
-
- if(!wrapper_in) {
- wrapper = return_value;
- } else {
- wrapper = wrapper_in;
- }
-
-
- ce = xsl_xsltprocessor_class_entry;
-
- if(!wrapper_in) {
- object_init_ex(wrapper, ce);
- }
- php_xsl_set_object(wrapper, (void *) obj TSRMLS_CC);
- return (wrapper);
-}
-/* }}} */
-
-
-
-
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(xsl)
-{
- /* uncomment this line if you have INI entries
- UNREGISTER_INI_ENTRIES();
- */
- xsltCleanupGlobals();
-
- return SUCCESS;
-}
-/* }}} */
-
-/* Remove if there's nothing to do at request start */
-/* {{{ PHP_RINIT_FUNCTION
- */
-PHP_RINIT_FUNCTION(xsl)
-{
- return SUCCESS;
-}
-/* }}} */
-
-/* Remove if there's nothing to do at request end */
-/* {{{ PHP_RSHUTDOWN_FUNCTION
- */
-PHP_RSHUTDOWN_FUNCTION(xsl)
-{
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(xsl)
-{
- php_info_print_table_start();
- {
- char buffer[128];
- int major, minor, subminor;
-
- php_info_print_table_row(2, "XSL", "enabled");
- major = xsltLibxsltVersion/10000;
- minor = (xsltLibxsltVersion - major * 10000) / 100;
- subminor = (xsltLibxsltVersion - major * 10000 - minor * 100);
- snprintf(buffer, 128, "%d.%d.%d", major, minor, subminor);
- php_info_print_table_row(2, "libxslt Version", buffer);
- major = xsltLibxmlVersion/10000;
- minor = (xsltLibxmlVersion - major * 10000) / 100;
- subminor = (xsltLibxmlVersion - major * 10000 - minor * 100);
- snprintf(buffer, 128, "%d.%d.%d", major, minor, subminor);
- php_info_print_table_row(2, "libxslt compiled against libxml Version", buffer);
- }
-#if HAVE_XSL_EXSLT
- php_info_print_table_row(2, "EXSLT", "enabled");
- php_info_print_table_row(2, "libexslt Version", LIBEXSLT_DOTTED_VERSION);
-#endif
- php_info_print_table_end();
-
- /* Remove comments if you have entries in php.ini
- DISPLAY_INI_ENTRIES();
- */
-}
-/* }}} */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h
deleted file mode 100644
index f0933063c9..0000000000
--- a/ext/xsl/php_xsl.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifndef PHP_XSL_H
-#define PHP_XSL_H
-
-extern zend_module_entry xsl_module_entry;
-#define phpext_xsl_ptr &xsl_module_entry
-
-#ifdef PHP_WIN32
-#define PHP_XSL_API __declspec(dllexport)
-#else
-#define PHP_XSL_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-#include <libxslt/xsltconfig.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/xsltutils.h>
-#include <libxslt/transform.h>
-#if HAVE_XSL_EXSLT
-#include <libexslt/exslt.h>
-#include <libexslt/exsltconfig.h>
-#endif
-
-#include "../dom/xml_common.h"
-#include "xsl_fe.h"
-
-#include <libxslt/extensions.h>
-#include <libxml/xpathInternals.h>
-
-typedef struct _xsl_object {
- zend_object std;
- void *ptr;
- HashTable *prop_handler;
- zend_object_handle handle;
- HashTable *parameter;
- int hasKeys;
- int registerPhpFunctions;
-} xsl_object;
-
-void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC);
-void xsl_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC);
-zval *php_xsl_create_object(xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval *return_value TSRMLS_DC);
-
-#define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \
-INIT_CLASS_ENTRY(ce, name, funcs); \
-ce.create_object = xsl_objects_new; \
-entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC);
-
-#define XSL_DOMOBJ_NEW(zval, obj, ret) \
- if (NULL == (zval = php_xsl_create_object(obj, ret, zval, return_value TSRMLS_CC))) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \
- RETURN_FALSE; \
- }
-
-
-
-PHP_MINIT_FUNCTION(xsl);
-PHP_MSHUTDOWN_FUNCTION(xsl);
-PHP_RINIT_FUNCTION(xsl);
-PHP_RSHUTDOWN_FUNCTION(xsl);
-PHP_MINFO_FUNCTION(xsl);
-
-
-/*
- Declare any global variables you may need between the BEGIN
- and END macros here:
-
-ZEND_BEGIN_MODULE_GLOBALS(xsl)
- long global_value;
- char *global_string;
-ZEND_END_MODULE_GLOBALS(xsl)
-*/
-
-/* In every utility function you add that needs to use variables
- in php_xsl_globals, call TSRM_FETCH(); after declaring other
- variables used by that function, or better yet, pass in TSRMLS_CC
- after the last function argument and declare your utility function
- with TSRMLS_DC after the last declared argument. Always refer to
- the globals in your function as XSL_G(variable). You are
- encouraged to rename these macros something shorter, see
- examples in any other php module directory.
-*/
-
-#ifdef ZTS
-#define XSL_G(v) TSRMG(xsl_globals_id, zend_xsl_globals *, v)
-#else
-#define XSL_G(v) (xsl_globals.v)
-#endif
-
-#endif /* PHP_XSL_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/xsl/tests/area_list.xsl b/ext/xsl/tests/area_list.xsl
deleted file mode 100644
index e0c88c6215..0000000000
--- a/ext/xsl/tests/area_list.xsl
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
- <xsl:output method="text" encoding="UTF-8"/>
-
- <xsl:key name="area" match="ROW" use="substring(translate(AREA_NAME, '&quot;', ''), 1, 1)"/>
-<xsl:template match="*">
- HERE
-</xsl:template>
-</xsl:stylesheet>
diff --git a/ext/xsl/tests/area_name.xml b/ext/xsl/tests/area_name.xml
deleted file mode 100644
index 76cea58511..0000000000
--- a/ext/xsl/tests/area_name.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<AREA_NAME>
- <ROW>
- <AREA_CODE>13</AREA_CODE>
- <AREA_NAME>&quot;Автово&quot; м.</AREA_NAME>
- <AREA_NAME_ENG>m.&quot;Avtovo&quot;</AREA_NAME_ENG>
- </ROW>
-</AREA_NAME>
-
-
-
diff --git a/ext/xsl/tests/bug26384.phpt b/ext/xsl/tests/bug26384.phpt
deleted file mode 100644
index b8f80f8c3e..0000000000
--- a/ext/xsl/tests/bug26384.phpt
+++ /dev/null
@@ -1,33 +0,0 @@
---TEST--
-Bug #26384 (domxslt->process causes segfault with xsl:key)
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-$dom = new domDocument;
-$dom->load(dirname(__FILE__)."/area_name.xml");
-if(!$dom) {
- echo "Error while parsing the document\n";
- exit;
-}
-$xsl = new domDocument;
-$xsl->load(dirname(__FILE__)."/area_list.xsl");
-if(!$xsl) {
- echo "Error while parsing the document\n";
- exit;
-}
-$proc = new xsltprocessor;
-if(!$proc) {
- echo "Error while making xsltprocessor object\n";
- exit;
-}
-
-$proc->importStylesheet($xsl);
-print $proc->transformToXml($dom);
-
-//this segfaulted before
-print $dom->documentElement->firstChild->nextSibling->nodeName;
-
---EXPECT--
-HERE
-ROW
diff --git a/ext/xsl/tests/documentxpath.xsl b/ext/xsl/tests/documentxpath.xsl
deleted file mode 100644
index 0e5c5c181d..0000000000
--- a/ext/xsl/tests/documentxpath.xsl
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Id: documentxpath.xsl,v 1.1 2003-10-27 15:12:20 chregu Exp $ -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
- <xsl:output method="xml" encoding="iso-8859-1" indent="no"/>
-<xsl:template match="/">
-
-<xsl:value-of select="document('compress.zlib://ext/xsl/tests/xslt.xsl.gz')/xsl:stylesheet/xsl:param/@name"/>
-</xsl:template>
-
- </xsl:stylesheet>
diff --git a/ext/xsl/tests/exslt.xml b/ext/xsl/tests/exslt.xml
deleted file mode 100644
index 0d9c8eb75b..0000000000
--- a/ext/xsl/tests/exslt.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>
-<page>
- <!-- valid xs:date -->
- <date date="0001-12-31Z"/>
- <date date="3000-01-31"/>
- <date date="2000-02-29"/>
- <date date="9990001-12-31Z"/>
- <date date="-0004-02-29"/>
-</page>
-
diff --git a/ext/xsl/tests/exslt.xsl b/ext/xsl/tests/exslt.xsl
deleted file mode 100644
index 06ffd8d60d..0000000000
--- a/ext/xsl/tests/exslt.xsl
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:date="http://exslt.org/dates-and-times"
- extension-element-prefixes="date">
-
-<xsl:output method="text"/>
-
-<xsl:template match="date">
- Test Date : <xsl:value-of select="@date"/>
- <!-- dateTime, date, gYearMonth or gYear; else NaN -->
- year : <xsl:value-of select="date:year(@date)"/>
- <!-- dateTime, date, gYearMonth or gYear; else NaN -->
- leap-year : <xsl:value-of select="date:leap-year(@date)"/>
- <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
- month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
- <!-- dateTime, date, gYearMonth or gMonth; else '' -->
- month-name : <xsl:value-of select="date:month-name(@date)"/>
- <!-- dateTime, date, gYearMonth or gMonth; else '' -->
- month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
- <!-- dateTime or date; else NaN -->
- week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
- <!-- dateTime, date; else NaN -->
- day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
- <!-- dateTime, date, gMonthDay or gDay; else NaN -->
- day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
- <!-- dateTime, date; else NaN -->
- day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
- <!-- dateTime, date; else NaN -->
- day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
- <!-- dateTime or date; else NaN -->
- day-name : <xsl:value-of select="date:day-name(@date)"/>
- <!-- dateTime or date; else NaN -->
- day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
- <!-- dateTime or time; else '' -->
- time : <xsl:value-of select="date:time(@date)"/>
- <!-- dateTime or time; else NaN -->
- hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
- <!-- dateTime or time; else NaN -->
- minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
- <!-- dateTime or time; else NaN -->
- second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
-</xsl:template>
-
-</xsl:stylesheet>
-
diff --git a/ext/xsl/tests/prepare.inc b/ext/xsl/tests/prepare.inc
deleted file mode 100644
index bd5bbee40c..0000000000
--- a/ext/xsl/tests/prepare.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-$dom = new domDocument;
-$dom->load(dirname(__FILE__)."/xslt.xml");
-if(!$dom) {
- echo "Error while parsing the document\n";
- exit;
-}
-$xsl = new domDocument;
-$xsl->load(dirname(__FILE__)."/xslt.xsl");
-if(!$xsl) {
- echo "Error while parsing the document\n";
- exit;
-}
-$proc = new xsltprocessor;
-if(!$proc) {
- echo "Error while making xsltprocessor object\n";
- exit;
-}
-
-?>
diff --git a/ext/xsl/tests/skipif.inc b/ext/xsl/tests/skipif.inc
deleted file mode 100644
index 0ef73723a3..0000000000
--- a/ext/xsl/tests/skipif.inc
+++ /dev/null
@@ -1 +0,0 @@
-<?php if (!extension_loaded('xsl')) die('skip xsl extension not available');?>
diff --git a/ext/xsl/tests/streamsinclude.xsl b/ext/xsl/tests/streamsinclude.xsl
deleted file mode 100644
index 6f8bc40ed9..0000000000
--- a/ext/xsl/tests/streamsinclude.xsl
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Id: streamsinclude.xsl,v 1.1 2003-10-27 15:12:20 chregu Exp $ -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
- <xsl:output method="xml" encoding="iso-8859-1" indent="no"/>
- <xsl:include href="compress.zlib://xslt.xsl.gz"/>
-</xsl:stylesheet>
diff --git a/ext/xsl/tests/xslt.xml b/ext/xsl/tests/xslt.xml
deleted file mode 100644
index b0e9506c7b..0000000000
--- a/ext/xsl/tests/xslt.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version='1.0' encoding="iso-8859-1" ?>
-<chapter language="en">
- <title language="en">Title</title>
- <para language="ge">
-
-<!-- comment -->
- <informaltable>
- <tgroup cols="3">
- <tbody>
- <row>
- <entry>a1</entry>
- <entry morerows="1">b1</entry>
- <entry>c1</entry>
- </row>
- <row>
- <entry>a2</entry>
- <entry>c2</entry>
- </row>
- <row>
- <entry>3</entry>
- <entry>b3</entry>
- <entry>c3</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </para>
-</chapter>
diff --git a/ext/xsl/tests/xslt.xsl b/ext/xsl/tests/xslt.xsl
deleted file mode 100644
index 8331ccc2b5..0000000000
--- a/ext/xsl/tests/xslt.xsl
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Id: xslt.xsl,v 1.2 2003-11-29 13:01:19 chregu Exp $ -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
-
- <xsl:output method="xml" encoding="iso-8859-1" indent="no"/>
- <xsl:param name="foo" select="'bar'"/>
- <xsl:template match="/">
- <html>
- <body>
- <xsl:value-of select="$foo"/><xsl:text>
-</xsl:text>
- <xsl:apply-templates select="/chapter/para/informaltable/tgroup/tbody/row"/>
- </body>
- </html>
- </xsl:template>
-
- <xsl:template match="row">
- <xsl:for-each select="entry">
- <xsl:value-of select="."/>
- <xsl:text> </xsl:text>
- </xsl:for-each>
- <br/> <xsl:text>
-</xsl:text>
-
- </xsl:template>
-</xsl:stylesheet>
diff --git a/ext/xsl/tests/xslt.xsl.gz b/ext/xsl/tests/xslt.xsl.gz
deleted file mode 100644
index 910bb63c8e..0000000000
--- a/ext/xsl/tests/xslt.xsl.gz
+++ /dev/null
Binary files differ
diff --git a/ext/xsl/tests/xslt001.phpt b/ext/xsl/tests/xslt001.phpt
deleted file mode 100644
index 885e7c9824..0000000000
--- a/ext/xsl/tests/xslt001.phpt
+++ /dev/null
@@ -1,22 +0,0 @@
---TEST--
-Test 1: Transform To XML String
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-echo "Test 1: Transform To XML String";
-include("prepare.inc");
-$proc->importStylesheet($xsl);
-print "\n";
-print $proc->transformToXml($dom);
-print "\n";
-
-
---EXPECT--
-Test 1: Transform To XML String
-<?xml version="1.0" encoding="iso-8859-1"?>
-<html><body>bar
-a1 b1 c1 <br/>
-a2 c2 <br/>
-3 b3 c3 <br/>
-</body></html>
diff --git a/ext/xsl/tests/xslt002.phpt b/ext/xsl/tests/xslt002.phpt
deleted file mode 100644
index 6c9f0c632c..0000000000
--- a/ext/xsl/tests/xslt002.phpt
+++ /dev/null
@@ -1,29 +0,0 @@
---TEST--
-Test 2: Transform To HTML String
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-echo "Test 2: Transform To HTML String";
-include("prepare.inc");
-// changing output method to html
-$xp = new domxpath($xsl);
-$res = $xp->query("/xsl:stylesheet/xsl:output/@method");
-if ($res->length != 1) {
- print "No or more than one xsl:output/@method found";
- exit;
-}
-$res->item(0)->value = "html";
-$proc->importStylesheet($xsl);
-print "\n";
-print $proc->transformToXml($dom);
-print "\n";
-
-
---EXPECT--
-Test 2: Transform To HTML String
-<html><body>bar
-a1 b1 c1 <br>
-a2 c2 <br>
-3 b3 c3 <br>
-</body></html>
diff --git a/ext/xsl/tests/xslt003.phpt b/ext/xsl/tests/xslt003.phpt
deleted file mode 100644
index a3c848b1b7..0000000000
--- a/ext/xsl/tests/xslt003.phpt
+++ /dev/null
@@ -1,23 +0,0 @@
---TEST--
-Test 3: Using Parameters
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-echo "Test 3: Using Parameters";
-include("prepare.inc");
-$proc->importStylesheet($xsl);
-$proc->setParameter( "", "foo","hello world");
-print "\n";
-print $proc->transformToXml($dom);
-print "\n";
-
-
---EXPECT--
-Test 3: Using Parameters
-<?xml version="1.0" encoding="iso-8859-1"?>
-<html><body>hello world
-a1 b1 c1 <br/>
-a2 c2 <br/>
-3 b3 c3 <br/>
-</body></html>
diff --git a/ext/xsl/tests/xslt004.phpt b/ext/xsl/tests/xslt004.phpt
deleted file mode 100644
index 6e8f476018..0000000000
--- a/ext/xsl/tests/xslt004.phpt
+++ /dev/null
@@ -1,29 +0,0 @@
---TEST--
-Test 4: Checking UTF8 Output
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-echo "Test 4: Checking UTF8 Output";
-include("prepare.inc");
-$xp = new domxpath($xsl);
-$res = $xp->query("/xsl:stylesheet/xsl:output/@encoding");
-if ($res->length != 1) {
- print "No or more than one xsl:output/@encoding found";
- exit;
-}
-$res->item(0)->value = "utf-8";
-$proc->importStylesheet($xsl);
-print "\n";
-print $proc->transformToXml($dom);
-print "\n";
-
-
---EXPECT--
-Test 4: Checking UTF8 Output
-<?xml version="1.0" encoding="utf-8"?>
-<html><body>bar
-a1 b1 c1 <br/>
-a2 c2 <br/>
-ä3 b3 c3 <br/>
-</body></html>
diff --git a/ext/xsl/tests/xslt005.phpt b/ext/xsl/tests/xslt005.phpt
deleted file mode 100644
index a70e6ea4f1..0000000000
--- a/ext/xsl/tests/xslt005.phpt
+++ /dev/null
@@ -1,31 +0,0 @@
---TEST--
-Test 5: Checking Indent
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-echo "Test 5: Checking Indent";
-include("prepare.inc");
-$xp = new domxpath($xsl);
-$res = $xp->query("/xsl:stylesheet/xsl:output/@indent");
-if ($res->length != 1) {
- print "No or more than one xsl:output/@indent found";
- exit;
-}
-$res->item(0)->value = "yes";
-$proc->importStylesheet($xsl);
-print "\n";
-print $proc->transformToXml($dom);
-print "\n";
-
-
---EXPECT--
-Test 5: Checking Indent
-<?xml version="1.0" encoding="iso-8859-1"?>
-<html>
- <body>bar
-a1 b1 c1 <br/>
-a2 c2 <br/>
-3 b3 c3 <br/>
-</body>
-</html>
diff --git a/ext/xsl/tests/xslt006.phpt b/ext/xsl/tests/xslt006.phpt
deleted file mode 100644
index 26fada1650..0000000000
--- a/ext/xsl/tests/xslt006.phpt
+++ /dev/null
@@ -1,23 +0,0 @@
---TEST--
-Test 6: Transform To Doc
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-echo "Test 6: Transform To Doc";
-include("prepare.inc");
-$proc->importStylesheet($xsl);
-print "\n";
-$doc = $proc->transformToDoc($dom);
-print $doc->saveXML();
-print "\n";
-
-
---EXPECT--
-Test 6: Transform To Doc
-<?xml version="1.0" encoding="iso-8859-1"?>
-<html><body>bar
-a1 b1 c1 <br/>
-a2 c2 <br/>
-3 b3 c3 <br/>
-</body></html>
diff --git a/ext/xsl/tests/xslt007.phpt b/ext/xsl/tests/xslt007.phpt
deleted file mode 100644
index bc6ad8477a..0000000000
--- a/ext/xsl/tests/xslt007.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-Test 7: Transform To Uri
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-echo "Test 7: Transform To Uri";
-include("prepare.inc");
-$proc->importStylesheet($xsl);
-print "\n";
-$doc = $proc->transformToUri($dom, "file://".dirname(__FILE__)."/out.xml");
-print file_get_contents(dirname(__FILE__)."/out.xml");
-unlink(dirname(__FILE__)."/out.xml");
-print "\n";
-
-
---EXPECT--
-Test 7: Transform To Uri
-<?xml version="1.0" encoding="iso-8859-1"?>
-<html><body>bar
-a1 b1 c1 <br/>
-a2 c2 <br/>
-3 b3 c3 <br/>
-</body></html>
diff --git a/ext/xsl/tests/xslt008.phpt b/ext/xsl/tests/xslt008.phpt
deleted file mode 100644
index b6dc37bfd0..0000000000
--- a/ext/xsl/tests/xslt008.phpt
+++ /dev/null
@@ -1,28 +0,0 @@
---TEST--
-Test 8: Stream Wrapper Includes
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-echo "Test 8: Stream Wrapper Includes ";
-include("prepare.inc");
-$xsl = new domDocument;
-$xsl->load(dirname(__FILE__)."/streamsinclude.xsl");
-if(!$xsl) {
- echo "Error while parsing the document\n";
- exit;
-}
-chdir(dirname(__FILE__));
-$proc->importStylesheet($xsl);
-print "\n";
-print $proc->transformToXML($dom);
-
-
---EXPECT--
-Test 8: Stream Wrapper Includes
-<?xml version="1.0" encoding="iso-8859-1"?>
-<html><body>bar
-a1 b1 c1 <br/>
-a2 c2 <br/>
-3 b3 c3 <br/>
-</body></html>
diff --git a/ext/xsl/tests/xslt009.phpt b/ext/xsl/tests/xslt009.phpt
deleted file mode 100644
index dd8060f4b9..0000000000
--- a/ext/xsl/tests/xslt009.phpt
+++ /dev/null
@@ -1,25 +0,0 @@
---TEST--
-Test 9: Stream Wrapper XPath-Document()
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-echo "Test 9: Stream Wrapper XPath-Document()";
-include("prepare.inc");
-
-$xsl = new domDocument;
-$xsl->load(dirname(__FILE__)."/documentxpath.xsl");
-if(!$xsl) {
- echo "Error while parsing the document\n";
- exit;
-}
-
-$proc->importStylesheet($xsl);
-print "\n";
-print $proc->transformToXML($dom);
-
-
---EXPECT--
-Test 9: Stream Wrapper XPath-Document()
-<?xml version="1.0" encoding="iso-8859-1"?>
-foo
diff --git a/ext/xsl/tests/xslt010.phpt b/ext/xsl/tests/xslt010.phpt
deleted file mode 100644
index 7c46d030f4..0000000000
--- a/ext/xsl/tests/xslt010.phpt
+++ /dev/null
@@ -1,112 +0,0 @@
---TEST--
-Test 10: EXSLT Support
---SKIPIF--
-<?php require_once('skipif.inc');
-$proc = new xsltprocessor;
-if (!$proc->hasExsltSupport()) die('skip EXSLT support not available');?>
---FILE--
-<?php
-echo "Test 10: EXSLT Support";
-
-$dom = new domDocument();
- $dom->load(dirname(__FILE__)."/exslt.xsl");
- $proc = new xsltprocessor;
- $xsl = $proc->importStylesheet($dom);
-
- $xml = new DomDocument();
- $xml->load(dirname(__FILE__)."/exslt.xml");
-
- print $proc->transformToXml($xml);
---EXPECT--
-Test 10: EXSLT Support
-
-
- Test Date : 0001-12-31Z
- year : 1
- leap-year : false
- month-in-year : 12
- month-name : December
- month-abbreviation : Dec
- week-in-year : 53
- day-in-year : 365
- day-in-month : 31
- day-of-week-in-month : 5
- day-in-week : 2
- day-name : Monday
- day-abbreviation : Mon
- time :
- hour-in-day : NaN
- minute-in-hour : NaN
- second-in-minute : NaN
-
- Test Date : 3000-01-31
- year : 3000
- leap-year : false
- month-in-year : 1
- month-name : January
- month-abbreviation : Jan
- week-in-year : 5
- day-in-year : 31
- day-in-month : 31
- day-of-week-in-month : 5
- day-in-week : 6
- day-name : Friday
- day-abbreviation : Fri
- time :
- hour-in-day : NaN
- minute-in-hour : NaN
- second-in-minute : NaN
-
- Test Date : 2000-02-29
- year : 2000
- leap-year : true
- month-in-year : 2
- month-name : February
- month-abbreviation : Feb
- week-in-year : 8
- day-in-year : 60
- day-in-month : 29
- day-of-week-in-month : 5
- day-in-week : 3
- day-name : Tuesday
- day-abbreviation : Tue
- time :
- hour-in-day : NaN
- minute-in-hour : NaN
- second-in-minute : NaN
-
- Test Date : 9990001-12-31Z
- year : 9990001
- leap-year : false
- month-in-year : 12
- month-name : December
- month-abbreviation : Dec
- week-in-year : 53
- day-in-year : 365
- day-in-month : 31
- day-of-week-in-month : 5
- day-in-week : 2
- day-name : Monday
- day-abbreviation : Mon
- time :
- hour-in-day : NaN
- minute-in-hour : NaN
- second-in-minute : NaN
-
- Test Date : -0004-02-29
- year : -4
- leap-year : true
- month-in-year : 2
- month-name : February
- month-abbreviation : Feb
- week-in-year : 9
- day-in-year : 60
- day-in-month : 29
- day-of-week-in-month : 5
- day-in-week : 1
- day-name : Sunday
- day-abbreviation : Sun
- time :
- hour-in-day : NaN
- minute-in-hour : NaN
- second-in-minute : NaN
diff --git a/ext/xsl/tests/xslt011.phpt b/ext/xsl/tests/xslt011.phpt
deleted file mode 100644
index 39864ffb31..0000000000
--- a/ext/xsl/tests/xslt011.phpt
+++ /dev/null
@@ -1,51 +0,0 @@
---TEST--
-Test 11: php:function Support
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
-print "Test 11: php:function Support\n";
- Class foo {
- function foo() {}
- function __toString() { return "not a DomNode object";}
- }
-
-$dom = new domDocument();
- $dom->load(dirname(__FILE__)."/xslt011.xsl");
- $proc = new xsltprocessor;
- $xsl = $proc->importStylesheet($dom);
-
- $xml = new DomDocument();
- $xml->load(dirname(__FILE__)."/xslt011.xml");
- $proc->registerPHPFunctions();
- print $proc->transformToXml($xml);
-
- function foobar($id, $secondArg = "" ) {
- if (is_array($id)) {
- return $id[0]->value . " - " . $secondArg;
- } else {
- return $id . " - " . $secondArg;
- }
- }
- function nodeSet($id = null) {
- if ($id and is_array($id)) {
- return $id[0];
- } else {
- $dom = new domdocument;
- $dom->loadXML("<root>this is from an external DomDocument</root>");
- return $dom->documentElement;
- }
- }
- function nonDomNode() {
- return new foo();
- }
---EXPECTF--
-Test 11: php:function Support
-
-Warning: xsltprocessor::transformToXml(): A PHP Object can not be converted to a XPath-string in %s on line 16
-<?xml version="1.0"?>
-foobar - secondArg
-foobar -
-this is from an external DomDocument
-from the Input Document
-
diff --git a/ext/xsl/tests/xslt011.xml b/ext/xsl/tests/xslt011.xml
deleted file mode 100644
index f40500b0f5..0000000000
--- a/ext/xsl/tests/xslt011.xml
+++ /dev/null
@@ -1 +0,0 @@
-<doc id="foobar">This is <i>from the Input Document</i></doc>
diff --git a/ext/xsl/tests/xslt011.xsl b/ext/xsl/tests/xslt011.xsl
deleted file mode 100644
index 55609bbeaa..0000000000
--- a/ext/xsl/tests/xslt011.xsl
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:php="http://php.net/xsl"
- xsl:extension-element-prefixes="php"
- version='1.0'>
-<xsl:template match="/">
-<xsl:value-of select="php:functionString('foobar', /doc/@id, 'secondArg')"/>
-<xsl:text>
-</xsl:text>
-<xsl:value-of select="php:function('foobar', /doc/@id)"/>
-<xsl:text>
-</xsl:text>
-<xsl:value-of select="php:function('nodeSet')"/>
-<xsl:text>
-</xsl:text>
-<xsl:value-of select="php:function('nodeSet',/doc)/i"/>
-<xsl:text>
-</xsl:text>
-<xsl:value-of select="php:function('nonDomNode')"/>
-</xsl:template>
-</xsl:stylesheet>
diff --git a/ext/xsl/xsl.dsp b/ext/xsl/xsl.dsp
deleted file mode 100644
index ff7257d161..0000000000
--- a/ext/xsl/xsl.dsp
+++ /dev/null
@@ -1,120 +0,0 @@
-# Microsoft Developer Studio Project File - Name="xsl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=xsl - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "xsl.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "xsl.mak" CFG="xsl - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "xsl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "xsl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "xsl - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" /D "LIBXML_THREAD_ENABLED" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 wsock32.lib php5ts.lib libxslt_a.lib libexslt_a.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xsl.dll" /implib:".Release_TS/php_xsl.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "xsl - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib libxslt_a.lib libexslt_a.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xsl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt"
-
-!ENDIF
-
-# Begin Target
-
-# Name "xsl - Win32 Release_TS"
-# Name "xsl - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_xsl.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\xsltprocessor.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_xsl.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\xsl_fe.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/xsl/xsl_fe.h b/ext/xsl/xsl_fe.h
deleted file mode 100644
index d0c673271a..0000000000
--- a/ext/xsl/xsl_fe.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Christian Stocker <chregu@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifndef XSL_FE_H
-#define XSL_FE_H
-
-extern zend_function_entry php_xsl_xsltprocessor_class_functions[];
-zend_class_entry *xsl_xsltprocessor_class_entry;
-
-PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet);
-PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc);
-PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri);
-PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml);
-PHP_FUNCTION(xsl_xsltprocessor_set_parameter);
-PHP_FUNCTION(xsl_xsltprocessor_get_parameter);
-PHP_FUNCTION(xsl_xsltprocessor_remove_parameter);
-PHP_FUNCTION(xsl_xsltprocessor_has_exslt_support);
-PHP_FUNCTION(xsl_xsltprocessor_register_php_functions);
-#endif
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
deleted file mode 100644
index d02682e98f..0000000000
--- a/ext/xsl/xsltprocessor.c
+++ /dev/null
@@ -1,659 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Christian Stocker <chregu@php.net> |
- | Rob Richards <rrichards@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_xsl.h"
-#include "ext/libxml/php_libxml.h"
-
-static void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs);
-static void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
-
-/*
-* class xsl_xsltprocessor
-*
-* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#
-* Since:
-*/
-
-zend_function_entry php_xsl_xsltprocessor_class_functions[] = {
- PHP_FALIAS(importStylesheet, xsl_xsltprocessor_import_stylesheet, NULL)
- PHP_FALIAS(transformToDoc, xsl_xsltprocessor_transform_to_doc, NULL)
- PHP_FALIAS(transformToUri, xsl_xsltprocessor_transform_to_uri, NULL)
- PHP_FALIAS(transformToXml, xsl_xsltprocessor_transform_to_xml, NULL)
- PHP_FALIAS(setParameter, xsl_xsltprocessor_set_parameter, NULL)
- PHP_FALIAS(getParameter, xsl_xsltprocessor_get_parameter, NULL)
- PHP_FALIAS(removeParameter, xsl_xsltprocessor_remove_parameter, NULL)
- PHP_FALIAS(hasExsltSupport, xsl_xsltprocessor_has_exslt_support, NULL)
- PHP_FALIAS(registerPHPFunctions, xsl_xsltprocessor_register_php_functions, NULL)
- {NULL, NULL, NULL}
-};
-
-/* {{{ attribute protos, not implemented yet */
-/* {{{ php_xsl_xslt_string_to_xpathexpr()
- Translates a string to a XPath Expression */
-static char *php_xsl_xslt_string_to_xpathexpr(const char *str TSRMLS_DC)
-{
- const xmlChar *string = (const xmlChar *)str;
-
- xmlChar *value;
- int str_len;
-
- str_len = xmlStrlen(string) + 3;
-
- if (xmlStrchr(string, '"')) {
- if (xmlStrchr(string, '\'')) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes)");
- return NULL;
- }
- value = (xmlChar*) safe_emalloc (str_len, sizeof(xmlChar), 0);
- snprintf(value, str_len, "'%s'", string);
- } else {
- value = (xmlChar*) safe_emalloc (str_len, sizeof(xmlChar), 0);
- snprintf(value, str_len, "\"%s\"", string);
- }
- return (char *) value;
-}
-
-static void php_xsl_unregister_php_functions() {
- xsltUnregisterExtModuleFunction ((const xmlChar *) "functionString",
- (const xmlChar *) "http://php.net/xsl");
- xsltUnregisterExtModuleFunction ((const xmlChar *) "function",
- (const xmlChar *) "http://php.net/xsl");
-}
-
-
-/* {{{ php_xsl_xslt_make_params()
- Translates a PHP array to a libxslt parameters array */
-static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS_DC)
-{
-
- int parsize;
- zval **value;
- char *xpath_expr, *string_key = NULL;
- ulong num_key;
- char **params = NULL;
- int i = 0;
-
- parsize = (2 * zend_hash_num_elements(parht) + 1) * sizeof(char *);
- params = (char **)emalloc(parsize);
- memset((char *)params, 0, parsize);
-
- for (zend_hash_internal_pointer_reset(parht);
- zend_hash_get_current_data(parht, (void **)&value) == SUCCESS;
- zend_hash_move_forward(parht)) {
-
- if (zend_hash_get_current_key(parht, &string_key, &num_key, 1) != HASH_KEY_IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument or parameter array");
- return NULL;
- } else {
- if (Z_TYPE_PP(value) != IS_STRING) {
- SEPARATE_ZVAL(value);
- convert_to_string(*value);
- }
-
- if (!xpath_params) {
- xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC);
- } else {
- xpath_expr = estrndup(Z_STRVAL_PP(value), strlen(Z_STRVAL_PP(value)));
- }
- if (xpath_expr) {
- params[i++] = string_key;
- params[i++] = xpath_expr;
- }
- }
- }
-
- params[i++] = NULL;
-
- return params;
-}
-/* }}} */
-
-
-static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type)
-{
- xsltTransformContextPtr tctxt;
- zval **args;
- zval *retval;
- int result, i, ret;
- zend_fcall_info fci;
- zval handler;
- xmlXPathObjectPtr obj;
- char *str;
-
- TSRMLS_FETCH();
-
- tctxt = xsltXPathGetTransformContext(ctxt);
- if (tctxt == NULL) {
- xsltGenericError(xsltGenericErrorContext,
- "xsltExtFunctionTest: failed to get the transformation context\n");
- return;
- }
-
- fci.param_count = nargs - 1;
- fci.params = safe_emalloc(fci.param_count, sizeof(zval**), 0);
-
- args = safe_emalloc(nargs - 1, sizeof(zval *), 0);
- /* Reverse order to pop values off ctxt stack */
- for (i = nargs - 2; i >= 0; i--) {
- obj = valuePop(ctxt);
- MAKE_STD_ZVAL(args[i]);
- switch (obj->type) {
- case XPATH_STRING:
- ZVAL_STRING(args[i], obj->stringval, 1);
- break;
- case XPATH_BOOLEAN:
- ZVAL_BOOL(args[i], obj->boolval);
- break;
- case XPATH_NUMBER:
- ZVAL_DOUBLE(args[i], obj->floatval);
- break;
- case XPATH_NODESET:
- if (type == 1) {
- str = xmlXPathCastToString(obj);
- ZVAL_STRING(args[i], str, 1);
- xmlFree(str);
- } else if (type == 2) {
- int j;
- dom_object *intern;
- array_init(args[i]);
- if (obj->nodesetval->nodeNr > 0) {
- intern = (dom_object *) php_dom_object_get_data((void *) obj->nodesetval->nodeTab[0]->doc);
- for (j = 0; j < obj->nodesetval->nodeNr; j++) {
- xmlNodePtr node = obj->nodesetval->nodeTab[j];
- zval *child;
-
- MAKE_STD_ZVAL(child);
- /* not sure, if we need this... it's copied from xpath.c */
- if (node->type == XML_NAMESPACE_DECL) {
- xmlNsPtr curns;
- xmlNodePtr nsparent;
-
- nsparent = node->_private;
- curns = xmlNewNs(NULL, node->name, NULL);
- if (node->children) {
- curns->prefix = xmlStrdup((char *) node->children);
- }
- if (node->children) {
- node = xmlNewDocNode(node->doc, NULL, (char *) node->children, node->name);
- } else {
- node = xmlNewDocNode(node->doc, NULL, "xmlns", node->name);
- }
- node->type = XML_NAMESPACE_DECL;
- node->parent = nsparent;
- node->ns = curns;
- }
- child = php_dom_create_object(node, &ret, NULL, child, intern TSRMLS_CC);
- add_next_index_zval(args[i], child);
- }
- }
- }
- break;
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "php:function object type %d is not supported yet", obj->type);
- ZVAL_STRING(args[i], "", 0);
- }
- xmlXPathFreeObject(obj);
- fci.params[i] = &args[i];
- }
-
- fci.size = sizeof(fci);
- fci.function_table = EG(function_table);
-
- obj = valuePop(ctxt);
- if (obj->stringval == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Handler name must be a string");
- xmlXPathFreeObject(obj);
- for (i = 0; i < nargs - 1; i++) {
- zval_ptr_dtor(&args[i]);
- }
- efree(args);
- efree(fci.params);
- return;
- }
- INIT_PZVAL(&handler);
- ZVAL_STRING(&handler, obj->stringval, 1);
- xmlXPathFreeObject(obj);
-
- fci.function_name = &handler;
- fci.symbol_table = NULL;
- fci.object_pp = NULL;
- fci.retval_ptr_ptr = &retval;
- fci.no_separation = 0;
- /*fci.function_handler_cache = &function_ptr;*/
-
- result = zend_call_function(&fci, NULL TSRMLS_CC);
- if (result == FAILURE) {
- if (Z_TYPE(handler) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(&handler));
- }
- } else {
- if (retval->type == IS_OBJECT && instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) {
- 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 if (retval->type == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A PHP Object can not be converted to a XPath-string");
- valuePush(ctxt, xmlXPathNewString(""));
- } else {
- convert_to_string_ex(&retval);
- valuePush(ctxt, xmlXPathNewString( Z_STRVAL_P(retval)));
- }
- zval_ptr_dtor(&retval);
- }
- zval_dtor(&handler);
- for (i = 0; i < nargs - 1; i++) {
- zval_ptr_dtor(&args[i]);
- }
- efree(args);
- efree(fci.params);
-}
-
-static void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs)
-{
- xsl_ext_function_php(ctxt, nargs, 1);
-}
-
-static void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs)
-{
- xsl_ext_function_php(ctxt, nargs, 2);
-}
-
-
-/* {{{ proto xsl_xsltdocucument xsl_xsltprocessor_import_stylesheet(node index);
-URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#
-Since:
-*/
-PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
-{
- zval *id, *docp = NULL;
- xmlDoc *doc = NULL, *newdoc = NULL;
- xsltStylesheetPtr sheetp, oldsheetp;
- xsl_object *intern;
- php_libxml_node_object *docobj;
- int prevSubstValue, prevExtDtdValue, clone_docu;
- xmlNode *nodep;
- zend_object_handlers *std_hnd;
- zval *cloneDocu, *member;
-
- DOM_GET_THIS(id);
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) {
- RETURN_FALSE;
- }
-
- DOC_GET_OBJ(doc, docp, xmlDocPtr, docobj);
-
- /* libxslt uses _private, so we must copy the imported
- stylesheet document otherwise the node proxies will be a mess */
- newdoc = xmlCopyDoc(doc, 1);
- xmlNodeSetBase((xmlNodePtr) newdoc, (xmlChar *)doc->URL);
- prevSubstValue = xmlSubstituteEntitiesDefault(1);
- prevExtDtdValue = xmlLoadExtDtdDefaultValue;
- xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
-
- sheetp = xsltParseStylesheetDoc(newdoc);
- xmlSubstituteEntitiesDefault(prevSubstValue);
- xmlLoadExtDtdDefaultValue = prevExtDtdValue;
-
- if (!sheetp) {
- xmlFreeDoc(newdoc);
- RETURN_FALSE;
- }
-
- intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
-
- std_hnd = zend_get_std_object_handlers();
- MAKE_STD_ZVAL(member);
- ZVAL_STRING(member, "cloneDocument", 0);
- cloneDocu = std_hnd->read_property(id, member, 1 TSRMLS_CC);
- convert_to_long(cloneDocu);
- efree(member);
- clone_docu = Z_LVAL_P(cloneDocu);
- if (clone_docu == 0) {
- /* check if the stylesheet is using xsl:key, if yes, we have to clone the document _always_ before a transformation */
- nodep = xmlDocGetRootElement(sheetp->doc)->children;
- while (nodep) {
- if (nodep->type == XML_ELEMENT_NODE && xmlStrEqual(nodep->name, "key") && xmlStrEqual(nodep->ns->href, XSLT_NAMESPACE)) {
- intern->hasKeys = 1;
- break;
- }
- nodep = nodep->next;
- }
- } else {
- intern->hasKeys = clone_docu;
- }
-
- if ((oldsheetp = (xsltStylesheetPtr)intern->ptr)) {
- /* free wrapper */
- if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) {
- ((xsltStylesheetPtr) intern->ptr)->_private = NULL;
- }
- xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr);
- intern->ptr = NULL;
- }
-
- php_xsl_set_object(id, sheetp TSRMLS_CC);
-}
-/* }}} end xsl_xsltprocessor_import_stylesheet */
-
-
-/* {{{ proto xsl_document xsl_xsltprocessor_transform_to_doc(node doc [,boolean clone]);
-URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#
-Since:
-*/
-PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
-{
- zval *id, *rv = NULL, *docp = NULL;
- xmlDoc *doc = NULL;
- xmlDoc *newdocp;
- xsltStylesheetPtr sheetp;
- int ret, clone;
- char **params = NULL;
- xsl_object *intern;
- php_libxml_node_object *docobj;
-
- id = getThis();
- intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
- sheetp = (xsltStylesheetPtr) intern->ptr;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) {
- RETURN_FALSE;
- }
- DOC_GET_OBJ(doc, docp, xmlDocPtr, docobj);
-
- if (intern->parameter) {
- params = php_xsl_xslt_make_params(intern->parameter, 0 TSRMLS_CC);
- }
-
- if (intern->hasKeys == 1) {
- doc = xmlCopyDoc(doc, 1);
- }
- newdocp = xsltApplyStylesheet(sheetp, doc, (const char**) params);
-
- if (intern->registerPhpFunctions == 1) {
- php_xsl_unregister_php_functions();
- }
-
- if (intern->hasKeys == 1) {
- xmlFreeDoc(doc);
- }
-
- if (params) {
- clone = 0;
- while(params[clone]) {
- efree(params[clone++]);
- }
- efree(params);
- }
-
- if (newdocp) {
- DOM_RET_OBJ(rv, (xmlNodePtr) newdocp, &ret, NULL);
- } else {
- RETURN_FALSE;
- }
-
-}
-/* }}} end xsl_xsltprocessor_transform_to_doc */
-
-
-/* {{{ proto xsl_ xsl_xsltprocessor_transform_to_uri(node doc, string uri [,boolean clone]);
-*/
-PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
-{
- zval *id, *docp = NULL;
- xmlDoc *doc = NULL;
- xmlDoc *newdocp;
- xsltStylesheetPtr sheetp;
- int ret, uri_len, clone;
- char **params = NULL, *uri;
- xsl_object *intern;
- php_libxml_node_object *docobj;
-
- id = getThis();
- intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
- sheetp = (xsltStylesheetPtr) intern->ptr;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "os", &docp, &uri, &uri_len) == FAILURE) {
- RETURN_FALSE;
- }
-
- DOC_GET_OBJ(doc, docp, xmlDocPtr, docobj);
-
- if (intern->parameter) {
- params = php_xsl_xslt_make_params(intern->parameter, 0 TSRMLS_CC);
- }
-
- if (intern->hasKeys == 1) {
- doc = xmlCopyDoc(doc, 1);
- }
-
- newdocp = xsltApplyStylesheet(sheetp, doc, (const char**)params);
-
- if (intern->registerPhpFunctions == 1) {
- php_xsl_unregister_php_functions();
- }
-
- if (intern->hasKeys == 1) {
- xmlFreeDoc(doc);
- }
-
- if (params) {
- clone = 0;
- while(params[clone]) {
- efree(params[clone++]);
- }
- efree(params);
- }
-
- ret = -1;
- if (newdocp) {
- ret = xsltSaveResultToFilename(uri, newdocp, sheetp, 0);
- xmlFreeDoc(newdocp);
- }
-
- RETVAL_LONG(ret);
-}
-/* }}} end xsl_xsltprocessor_transform_to_uri */
-
-
-/* {{{ proto xsl_string xsl_xsltprocessor_transform_to_xml(node doc [,boolean clone]);
-*/
-PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
-{
- zval *id, *docp = NULL;
- xmlDoc *doc = NULL;
- xmlDoc *newdocp;
- xsltStylesheetPtr sheetp;
- int ret, clone;
- xmlChar *doc_txt_ptr;
- int doc_txt_len;
- char **params = NULL;
- xsl_object *intern;
- php_libxml_node_object *docobj;
-
- id = getThis();
- intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
- sheetp = (xsltStylesheetPtr) intern->ptr;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) {
- RETURN_FALSE;
- }
- DOC_GET_OBJ(doc, docp, xmlDocPtr, docobj);
-
- if (intern->parameter) {
- params = php_xsl_xslt_make_params(intern->parameter, 0 TSRMLS_CC);
- }
-
- if (intern->hasKeys == 1) {
- doc = xmlCopyDoc(doc, 1);
- }
-
- newdocp = xsltApplyStylesheet(sheetp, doc, (const char**)params);
-
- if (intern->registerPhpFunctions == 1) {
- php_xsl_unregister_php_functions();
- }
-
- if (intern->hasKeys == 1) {
- xmlFreeDoc(doc);
- }
-
- if (params) {
- clone = 0;
- while(params[clone]) {
- efree(params[clone++]);
- }
- efree(params);
- }
-
- ret = -1;
- if (newdocp) {
- ret = xsltSaveResultToString(&doc_txt_ptr, &doc_txt_len, newdocp, sheetp);
- if (doc_txt_ptr) {
- RETVAL_STRINGL(doc_txt_ptr, doc_txt_len, 1);
- xmlFree(doc_txt_ptr);
- }
- xmlFreeDoc(newdocp);
- }
-
- if (ret < 0) {
- RETURN_FALSE;
- }
-}
-/* }}} end xsl_xsltprocessor_transform_to_xml */
-
-
-/* {{{ proto xsl_ xsl_xsltprocessor_set_parameter(string namespace, string name, string value);
-*/
-PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
-{
-
- zval *id;
- int name_len = 0, namespace_len = 0, value_len = 0;
- char *name, *namespace, *value;
- xsl_object *intern;
- zval *new_string;
-
- DOM_GET_THIS(id);
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &namespace, &namespace_len, &name, &name_len, &value, &value_len) == FAILURE) {
- RETURN_FALSE;
- }
- intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
-
-
- MAKE_STD_ZVAL(new_string);
- ZVAL_STRING(new_string, value, 1);
- zend_hash_update(intern->parameter, name, name_len + 1, &new_string, sizeof(zval*), NULL);
-}
-/* }}} end xsl_xsltprocessor_set_parameter */
-
-/* {{{ proto xsl_ xsl_xsltprocessor_get_parameter(string namespace, string name);
-*/
-PHP_FUNCTION(xsl_xsltprocessor_get_parameter)
-{
- zval *id;
- int name_len = 0, namespace_len = 0;
- char *name, *namespace;
- zval **value;
- xsl_object *intern;
-
- DOM_GET_THIS(id);
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &namespace, &namespace_len, &name, &name_len) == FAILURE) {
- RETURN_FALSE;
- }
- intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
- if ( zend_hash_find(intern->parameter, name, name_len + 1, (void**) &value) == SUCCESS) {
- convert_to_string_ex(value);
- RETVAL_STRING(Z_STRVAL_PP(value),1);
- } else {
- RETURN_FALSE;
- }
-}
-/* }}} end xsl_xsltprocessor_get_parameter */
-
-/* {{{ proto xsl_ xsl_xsltprocessor_remove_parameter(string namespace, string name);
-*/
-PHP_FUNCTION(xsl_xsltprocessor_remove_parameter)
-{
- zval *id;
- int name_len = 0, namespace_len = 0;
- char *name, *namespace;
- xsl_object *intern;
-
- DOM_GET_THIS(id);
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &namespace, &namespace_len, &name, &name_len) == FAILURE) {
- RETURN_FALSE;
- }
- intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
- if ( zend_hash_del(intern->parameter, name, name_len + 1) == SUCCESS) {
- RETURN_TRUE;
- } else {
- RETURN_FALSE;
- }
-}
-/* }}} end xsl_xsltprocessor_remove_parameter */
-
-/* {{{ proto xsl_xsltprocessor_register_php_functions();
-*/
-PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
-{
- zval *id;
- xsl_object *intern;
-
- DOM_GET_THIS(id);
-
-
- intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
- intern->registerPhpFunctions = 1;
-
- xsltRegisterExtModuleFunction ((const xmlChar *) "functionString",
- (const xmlChar *) "http://php.net/xsl",
- xsl_ext_function_string_php);
- xsltRegisterExtModuleFunction ((const xmlChar *) "function",
- (const xmlChar *) "http://php.net/xsl",
- xsl_ext_function_object_php);
-}
-/* }}} end xsl_xsltprocessor_register_php_functions(); */
-
-/* {{{ proto xsl_xsltprocessor_has_exslt_support();
-*/
-PHP_FUNCTION(xsl_xsltprocessor_has_exslt_support)
-{
-#if HAVE_XSL_EXSLT
- RETURN_TRUE;
-#else
- RETURN_FALSE;
-#endif
-}
-/* }}} end xsl_xsltprocessor_has_exslt_support(); */
-