reference/xsl/xsltprocessor/registerphpfunctions.xml
1d574504ad4c2a183f6f858694b35168af23de46
...
...
@@ -7,10 +7,9 @@
7
7
</refnamediv>
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
-
<methodsynopsis>
11
-
<type>void</type>
12
-
<methodname>XSLTProcessor::registerPHPFunctions</methodname>
13
-
<methodparam choice="opt"><type>mixed</type><parameter>restrict</parameter></methodparam>
10
+
<methodsynopsis role="XSLTProcessor">
11
+
<modifier>public</modifier> <type>void</type><methodname>XSLTProcessor::registerPHPFunctions</methodname>
12
+
<methodparam choice="opt"><type class="union"><type>array</type><type>string</type><type>null</type></type><parameter>functions</parameter><initializer>&null;</initializer></methodparam>
14
13
</methodsynopsis>
15
14
<para>
16
15
This method enables the ability to use PHP functions as XSLT functions
...
...
@@ -22,7 +21,7 @@
22
21
<para>
23
22
<variablelist>
24
23
<varlistentry>
25
-
<term><parameter>restrict</parameter></term>
24
+
<term><parameter>functions</parameter></term>
26
25
<listitem>
27
26
<para>
28
27
Use this parameter to only allow certain functions to be called from
...
...
@@ -80,8 +79,10 @@ $xsl = <<<EOB
80
79
</xsl:template>
81
80
</xsl:stylesheet>
82
81
EOB;
83
-
$xmldoc = DOMDocument::loadXML($xml);
84
-
$xsldoc = DOMDocument::loadXML($xsl);
82
+
$xmldoc = new DOMDocument();
83
+
$xmldoc->loadXML($xml);
84
+
$xsldoc = new DOMDocument();
85
+
$xsldoc->loadXML($xsl);
85
86

86
87
$proc = new XSLTProcessor();
87
88
$proc->registerPHPFunctions();
...
...
@@ -92,7 +93,6 @@ echo $proc->transformToXML($xmldoc);
92
93
</para>
93
94
</refsect1>
94
95
</refentry>
95
-

96
96
<!-- Keep this comment at the end of the file
97
97
Local variables:
98
98
mode: sgml
99
99