From 9ace8edadff3c9b197b96ecfd5e9be88f236fd80 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 22 Feb 2025 15:31:20 +0100 Subject: [PATCH 1/2] Document errors and changes in 8.4 for XSL and XPath --- reference/dom/domxpath/evaluate.xml | 3 +- reference/dom/domxpath/query.xml | 29 +++++++++++++++++++ .../dom/domxpath/registerphpfunctionns.xml | 4 ++- .../dom/domxpath/registerphpfunctions.xml | 28 ++++++++++++++++++ .../xsltprocessor/registerphpfunctionns.xml | 4 ++- .../xsltprocessor/registerphpfunctions.xml | 5 +++- .../xsl/xsltprocessor/transformtodoc.xml | 27 ++++------------- .../xsl/xsltprocessor/transformtouri.xml | 13 +++++++-- .../xsl/xsltprocessor/transformtoxml.xml | 25 +++------------- 9 files changed, 89 insertions(+), 49 deletions(-) diff --git a/reference/dom/domxpath/evaluate.xml b/reference/dom/domxpath/evaluate.xml index 1f8a240bd94f..3bb738c0b789 100644 --- a/reference/dom/domxpath/evaluate.xml +++ b/reference/dom/domxpath/evaluate.xml @@ -1,6 +1,6 @@ - + DOMXPath::evaluate @@ -46,6 +46,7 @@ + &reftitle.returnvalues; diff --git a/reference/dom/domxpath/query.xml b/reference/dom/domxpath/query.xml index 071d1e9685c9..5dd594962b7f 100644 --- a/reference/dom/domxpath/query.xml +++ b/reference/dom/domxpath/query.xml @@ -45,6 +45,35 @@ + + &reftitle.errors; + + The following errors are possible when using an expression that invokes + PHP callbacks. + + + + + Throws an Error if + a PHP callback is invoked but there were no callbacks registered, + or if the named callback was not registered. + + + + + Throws a TypeError if + the php:function syntax is used and the handler + name is not a string. + + + + + Throws an Error if + a non-DOM object was returned from a callback. + + + + &reftitle.returnvalues; diff --git a/reference/dom/domxpath/registerphpfunctionns.xml b/reference/dom/domxpath/registerphpfunctionns.xml index 238a8e4333a2..0643d6ff5cdd 100644 --- a/reference/dom/domxpath/registerphpfunctionns.xml +++ b/reference/dom/domxpath/registerphpfunctionns.xml @@ -1,6 +1,6 @@ - + DOMXPath::registerPhpFunctionNS Register a PHP functions as namespaced XPath function @@ -53,6 +53,8 @@ + + &reftitle.returnvalues; diff --git a/reference/dom/domxpath/registerphpfunctions.xml b/reference/dom/domxpath/registerphpfunctions.xml index 997e954a98f1..4dd329cd1883 100644 --- a/reference/dom/domxpath/registerphpfunctions.xml +++ b/reference/dom/domxpath/registerphpfunctions.xml @@ -41,6 +41,25 @@ + + &reftitle.errors; + + + + Throws a ValueError if + a callback name is not valid. + + + &dom.errors.compliant.common; + + + Throws a TypeError if + a given callback is not callable. + + + + + &reftitle.returnvalues; @@ -59,6 +78,15 @@ + + 8.4.0 + + Invalid callback names now throws a + ValueError. + Passing a non-callable entry now throws a + TypeError. + + 8.4.0 diff --git a/reference/xsl/xsltprocessor/registerphpfunctionns.xml b/reference/xsl/xsltprocessor/registerphpfunctionns.xml index 89f9334f1cc3..df832b453c22 100644 --- a/reference/xsl/xsltprocessor/registerphpfunctionns.xml +++ b/reference/xsl/xsltprocessor/registerphpfunctionns.xml @@ -1,6 +1,6 @@ - + XSLTProcessor::registerPHPFunctionNS Register a PHP function as namespaced XSLT function @@ -50,6 +50,8 @@ + + &reftitle.returnvalues; diff --git a/reference/xsl/xsltprocessor/registerphpfunctions.xml b/reference/xsl/xsltprocessor/registerphpfunctions.xml index 2b89bf17748d..adb53a29ab41 100644 --- a/reference/xsl/xsltprocessor/registerphpfunctions.xml +++ b/reference/xsl/xsltprocessor/registerphpfunctions.xml @@ -1,6 +1,6 @@ - + XSLTProcessor::registerPHPFunctions Enables the ability to use PHP functions as XSLT functions @@ -40,6 +40,8 @@ + + &reftitle.returnvalues; @@ -58,6 +60,7 @@ + 8.4.0 diff --git a/reference/xsl/xsltprocessor/transformtodoc.xml b/reference/xsl/xsltprocessor/transformtodoc.xml index 61839e3063b9..655db25fa642 100644 --- a/reference/xsl/xsltprocessor/transformtodoc.xml +++ b/reference/xsl/xsltprocessor/transformtodoc.xml @@ -1,6 +1,6 @@ - + XSLTProcessor::transformToDoc Transform to a document @@ -45,6 +45,9 @@ + + + &reftitle.returnvalues; @@ -52,27 +55,7 @@ - - &reftitle.changelog; - - - - - &Version; - &Description; - - - - - 8.4.0 - - Added support for Dom\Document. - - - - - - + &reftitle.examples; diff --git a/reference/xsl/xsltprocessor/transformtouri.xml b/reference/xsl/xsltprocessor/transformtouri.xml index 550daecad4a4..71174c747458 100644 --- a/reference/xsl/xsltprocessor/transformtouri.xml +++ b/reference/xsl/xsltprocessor/transformtouri.xml @@ -1,6 +1,6 @@ - + XSLTProcessor::transformToUri Transform to URI @@ -42,6 +42,8 @@ + + &reftitle.returnvalues; @@ -49,7 +51,7 @@ - + &reftitle.changelog; @@ -60,6 +62,13 @@ + + 8.4.0 + + Now throws an Error if the callback + cannot be invoked, instead of emitting a warning. + + 8.4.0 diff --git a/reference/xsl/xsltprocessor/transformtoxml.xml b/reference/xsl/xsltprocessor/transformtoxml.xml index 94a7c830e4d1..798380e55511 100644 --- a/reference/xsl/xsltprocessor/transformtoxml.xml +++ b/reference/xsl/xsltprocessor/transformtoxml.xml @@ -21,6 +21,9 @@ + + + &reftitle.returnvalues; @@ -28,27 +31,7 @@ - - &reftitle.changelog; - - - - - &Version; - &Description; - - - - - 8.4.0 - - Added support for Dom\Document. - - - - - - + &reftitle.examples; From ccc2245521e01609f7a41da4e0dfcf0da11a9013 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 22 Feb 2025 15:58:40 +0100 Subject: [PATCH 2/2] section order --- reference/dom/domxpath/query.xml | 28 +++++++++---------- .../dom/domxpath/registerphpfunctions.xml | 14 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/reference/dom/domxpath/query.xml b/reference/dom/domxpath/query.xml index 5dd594962b7f..f6640d97af6e 100644 --- a/reference/dom/domxpath/query.xml +++ b/reference/dom/domxpath/query.xml @@ -45,6 +45,20 @@ + + &reftitle.returnvalues; + + Returns a DOMNodeList containing all nodes matching + the given XPath expression. Any expression which + does not return nodes will return an empty + DOMNodeList. + + + If the expression is malformed or the + contextNode is invalid, + DOMXPath::query returns &false;. + + &reftitle.errors; @@ -74,20 +88,6 @@ - - &reftitle.returnvalues; - - Returns a DOMNodeList containing all nodes matching - the given XPath expression. Any expression which - does not return nodes will return an empty - DOMNodeList. - - - If the expression is malformed or the - contextNode is invalid, - DOMXPath::query returns &false;. - - &reftitle.examples; diff --git a/reference/dom/domxpath/registerphpfunctions.xml b/reference/dom/domxpath/registerphpfunctions.xml index 4dd329cd1883..ea9f5dbb22ff 100644 --- a/reference/dom/domxpath/registerphpfunctions.xml +++ b/reference/dom/domxpath/registerphpfunctions.xml @@ -41,6 +41,13 @@ + + &reftitle.returnvalues; + + &return.void; + + + &reftitle.errors; @@ -60,13 +67,6 @@ - - &reftitle.returnvalues; - - &return.void; - - - &reftitle.changelog;