Skip to content

Commit 01904e8

Browse files
authored
Document errors and changes in 8.4 for XSL and XPath (#4483)
1 parent 5baba54 commit 01904e8

File tree

9 files changed

+89
-49
lines changed

9 files changed

+89
-49
lines changed

reference/dom/domxpath/evaluate.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<refentry xml:id="domxpath.evaluate" xmlns="http://docbook.org/ns/docbook">
3+
<refentry xml:id="domxpath.evaluate" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
44
<refnamediv>
55
<refname>DOMXPath::evaluate</refname>
66
<refpurpose>
@@ -46,6 +46,7 @@
4646
</variablelist>
4747
</para>
4848
</refsect1>
49+
<xi:include xpointer="domxpath.query..errors" />
4950
<refsect1 role="returnvalues">
5051
&reftitle.returnvalues;
5152
<para>

reference/dom/domxpath/query.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,35 @@
5959
<methodname>DOMXPath::query</methodname> returns &false;.
6060
</para>
6161
</refsect1>
62+
<refsect1 role="errors" xml:id="domxpath.query..errors">
63+
&reftitle.errors;
64+
<simpara>
65+
The following errors are possible when using an expression that invokes
66+
PHP callbacks.
67+
</simpara>
68+
<itemizedlist>
69+
<listitem>
70+
<simpara>
71+
Throws an <exceptionname>Error</exceptionname> if
72+
a PHP callback is invoked but there were no callbacks registered,
73+
or if the named callback was not registered.
74+
</simpara>
75+
</listitem>
76+
<listitem>
77+
<simpara>
78+
Throws a <exceptionname>TypeError</exceptionname> if
79+
the <literal>php:function</literal> syntax is used and the handler
80+
name is not a string.
81+
</simpara>
82+
</listitem>
83+
<listitem>
84+
<simpara>
85+
Throws an <exceptionname>Error</exceptionname> if
86+
a non-DOM object was returned from a callback.
87+
</simpara>
88+
</listitem>
89+
</itemizedlist>
90+
</refsect1>
6291
<refsect1 role="examples">
6392
&reftitle.examples;
6493
<para>

reference/dom/domxpath/registerphpfunctionns.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<refentry xml:id="domxpath.registerphpfunctionns" xmlns="http://docbook.org/ns/docbook">
3+
<refentry xml:id="domxpath.registerphpfunctionns" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
44
<refnamediv>
55
<refname>DOMXPath::registerPhpFunctionNS</refname>
66
<refpurpose>Register a PHP functions as namespaced XPath function</refpurpose>
@@ -53,6 +53,8 @@
5353
</variablelist>
5454
</refsect1>
5555

56+
<xi:include xpointer="domxpath.registerphpfunctions..errors" />
57+
5658
<refsect1 role="returnvalues">
5759
&reftitle.returnvalues;
5860
<simpara>

reference/dom/domxpath/registerphpfunctions.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,25 @@
4848
</para>
4949
</refsect1>
5050

51+
<refsect1 role="errors" xml:id="domxpath.registerphpfunctions..errors">
52+
&reftitle.errors;
53+
<itemizedlist>
54+
<listitem>
55+
<simpara>
56+
Throws a <exceptionname>ValueError</exceptionname> if
57+
a callback name is not valid.
58+
</simpara>
59+
</listitem>
60+
&dom.errors.compliant.common;
61+
<listitem>
62+
<simpara>
63+
Throws a <exceptionname>TypeError</exceptionname> if
64+
a given callback is not callable.
65+
</simpara>
66+
</listitem>
67+
</itemizedlist>
68+
</refsect1>
69+
5170
<refsect1 role="changelog">
5271
&reftitle.changelog;
5372
<informaltable>
@@ -59,6 +78,15 @@
5978
</row>
6079
</thead>
6180
<tbody>
81+
<row xml:id="domxpath.registerphpfunctions..changelog.errors">
82+
<entry>8.4.0</entry>
83+
<entry>
84+
Invalid callback names now throws a
85+
<exceptionname>ValueError</exceptionname>.
86+
Passing a non-callable entry now throws a
87+
<exceptionname>TypeError</exceptionname>.
88+
</entry>
89+
</row>
6290
<row>
6391
<entry>8.4.0</entry>
6492
<entry>

reference/xsl/xsltprocessor/registerphpfunctionns.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<refentry xml:id="xsltprocessor.registerphpfunctionns" xmlns="http://docbook.org/ns/docbook">
3+
<refentry xml:id="xsltprocessor.registerphpfunctionns" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
44
<refnamediv>
55
<refname>XSLTProcessor::registerPHPFunctionNS</refname>
66
<refpurpose>Register a PHP function as namespaced XSLT function</refpurpose>
@@ -50,6 +50,8 @@
5050
</variablelist>
5151
</refsect1>
5252

53+
<xi:include xpointer="domxpath.registerphpfunctions..errors" />
54+
5355
<refsect1 role="returnvalues">
5456
&reftitle.returnvalues;
5557
<simpara>

reference/xsl/xsltprocessor/registerphpfunctions.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<refentry xml:id="xsltprocessor.registerphpfunctions" xmlns="http://docbook.org/ns/docbook">
3+
<refentry xml:id="xsltprocessor.registerphpfunctions" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
44
<refnamediv>
55
<refname>XSLTProcessor::registerPHPFunctions</refname>
66
<refpurpose>Enables the ability to use PHP functions as XSLT functions</refpurpose>
@@ -40,6 +40,8 @@
4040
</para>
4141
</refsect1>
4242

43+
<xi:include xpointer="domxpath.registerphpfunctions..errors" />
44+
4345
<refsect1 role="returnvalues">
4446
&reftitle.returnvalues;
4547
<para>
@@ -58,6 +60,7 @@
5860
</row>
5961
</thead>
6062
<tbody>
63+
<xi:include xpointer="domxpath.registerphpfunctions..changelog.errors" />
6164
<row>
6265
<entry>8.4.0</entry>
6366
<entry>

reference/xsl/xsltprocessor/transformtodoc.xml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<refentry xml:id="xsltprocessor.transformtodoc" xmlns="http://docbook.org/ns/docbook">
3+
<refentry xml:id="xsltprocessor.transformtodoc" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
44
<refnamediv>
55
<refname>XSLTProcessor::transformToDoc</refname>
66
<refpurpose>Transform to a document</refpurpose>
@@ -45,34 +45,17 @@
4545
</variablelist>
4646
</para>
4747
</refsect1>
48+
49+
<xi:include xpointer="domxpath.query..errors" />
50+
4851
<refsect1 role="returnvalues">
4952
&reftitle.returnvalues;
5053
<para>
5154
The resulting document or &false; on error.
5255
</para>
5356
</refsect1>
5457

55-
<refsect1 role="changelog">
56-
&reftitle.changelog;
57-
<informaltable>
58-
<tgroup cols="2">
59-
<thead>
60-
<row>
61-
<entry>&Version;</entry>
62-
<entry>&Description;</entry>
63-
</row>
64-
</thead>
65-
<tbody>
66-
<row>
67-
<entry>8.4.0</entry>
68-
<entry>
69-
Added support for <classname>Dom\Document</classname>.
70-
</entry>
71-
</row>
72-
</tbody>
73-
</tgroup>
74-
</informaltable>
75-
</refsect1>
58+
<xi:include xpointer="xsltprocessor.transformtouri..changelog" />
7659

7760
<refsect1 role="examples">
7861
&reftitle.examples;

reference/xsl/xsltprocessor/transformtouri.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<refentry xml:id="xsltprocessor.transformtouri" xmlns="http://docbook.org/ns/docbook">
3+
<refentry xml:id="xsltprocessor.transformtouri" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
44
<refnamediv>
55
<refname>XSLTProcessor::transformToUri</refname>
66
<refpurpose>Transform to URI</refpurpose>
@@ -42,14 +42,16 @@
4242
</para>
4343
</refsect1>
4444

45+
<xi:include xpointer="domxpath.query..errors" />
46+
4547
<refsect1 role="returnvalues">
4648
&reftitle.returnvalues;
4749
<para>
4850
Returns the number of bytes written or &false; if an error occurred.
4951
</para>
5052
</refsect1>
5153

52-
<refsect1 role="changelog">
54+
<refsect1 role="changelog" xml:id="xsltprocessor.transformtouri..changelog">
5355
&reftitle.changelog;
5456
<informaltable>
5557
<tgroup cols="2">
@@ -60,6 +62,13 @@
6062
</row>
6163
</thead>
6264
<tbody>
65+
<row>
66+
<entry>8.4.0</entry>
67+
<entry>
68+
Now throws an <exceptionname>Error</exceptionname> if the callback
69+
cannot be invoked, instead of emitting a warning.
70+
</entry>
71+
</row>
6372
<row>
6473
<entry>8.4.0</entry>
6574
<entry>

reference/xsl/xsltprocessor/transformtoxml.xml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,17 @@
2121
<xi:fallback/>
2222
</xi:include>
2323
</refsect1>
24+
25+
<xi:include xpointer="domxpath.query..errors" />
26+
2427
<refsect1 role="returnvalues">
2528
&reftitle.returnvalues;
2629
<para>
2730
The result of the transformation as a string or &false; on error.
2831
</para>
2932
</refsect1>
3033

31-
<refsect1 role="changelog">
32-
&reftitle.changelog;
33-
<informaltable>
34-
<tgroup cols="2">
35-
<thead>
36-
<row>
37-
<entry>&Version;</entry>
38-
<entry>&Description;</entry>
39-
</row>
40-
</thead>
41-
<tbody>
42-
<row>
43-
<entry>8.4.0</entry>
44-
<entry>
45-
Added support for <classname>Dom\Document</classname>.
46-
</entry>
47-
</row>
48-
</tbody>
49-
</tgroup>
50-
</informaltable>
51-
</refsect1>
34+
<xi:include xpointer="xsltprocessor.transformtouri..changelog" />
5235

5336
<refsect1 role="examples">
5437
&reftitle.examples;

0 commit comments

Comments
 (0)