php-src/ext/xsl/tests/xslt011.phpt
Christian Stocker 3f07e4364c @- Added possibility to call php functions as XSLT-functions (chregu)
- Added possibility to call php functions as XSLT-functions
  eg: <xsl:value-of select="php:function('date','r')"/>
  Namespace is http://php.net/functions
2003-11-28 22:08:16 +00:00

30 lines
607 B
PHP

--TEST--
Test 11: php:function Support
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
print "Test 11: php:function Support\n";
$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");
print $proc->transformToXml($xml);
function foobar($id ) {
if (is_array($id)) {
return $id[0]->value;
} else {
return $id;
}
}
--EXPECT--
Test 11: php:function Support
<?xml version="1.0"?>
foobar
foobar