From fa35af6366a50b904915ed972c0cd7273250ec12 Mon Sep 17 00:00:00 2001 From: "SUMIDA, Ippei" Date: Sun, 24 Nov 2024 22:13:29 +0900 Subject: [PATCH 1/3] =?UTF-8?q?DOMXPath::quote()=E3=81=AE=E7=BF=BB?= =?UTF-8?q?=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/dom/domxpath/quote.xml | 124 +++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 reference/dom/domxpath/quote.xml diff --git a/reference/dom/domxpath/quote.xml b/reference/dom/domxpath/quote.xml new file mode 100644 index 0000000000..01be416d18 --- /dev/null +++ b/reference/dom/domxpath/quote.xml @@ -0,0 +1,124 @@ + + + + + + DOMXPath::quote + + XPath 式で使用できるよう、文字列のまわりに引用符を付けます + + + + + &reftitle.description; + + public static stringDOMXPath::quote + stringstr + + + XPath 式で使用できるよう、 str のまわりに引用符を付けます。 + + + + + &reftitle.parameters; + + + + str + + + 引用符をつける文字列 + + + + + + + + + &reftitle.returnvalues; + + XPath 式に使うことのできる引用符付きの文字列を返します。 + + + + + &reftitle.examples; + + 引用符付きの属性の変換 + + loadXML(<< + Book title + +XML); +$xpath = new DOMXPath($doc); +$query = "//book[@name=" . DOMXPath::quote("'quoted' name") . "]"; +echo $query, "\n"; +$entries = $xpath->query($query); +foreach ($entries as $entry) { + echo "Found ", $entry->textContent, "\n"; +} +?> +]]> + + &example.outputs; + + + + + 引用符が混在している文字列もサポートします: + + + +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + + DOMXPath::evaluate + DOMXPath::query + + + + + \ No newline at end of file From 2f10e6308dc702bb4e4fca461b585e92681da178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Sun, 24 Nov 2024 23:00:40 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E6=94=B9=E8=A1=8C=E3=81=A8=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=87=E3=83=B3=E3=83=88=E3=82=92=E5=8E=9F=E6=96=87?= =?UTF-8?q?=E3=81=A8=E6=8F=83=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/dom/domxpath/quote.xml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/reference/dom/domxpath/quote.xml b/reference/dom/domxpath/quote.xml index 01be416d18..fdfba76341 100644 --- a/reference/dom/domxpath/quote.xml +++ b/reference/dom/domxpath/quote.xml @@ -48,7 +48,7 @@ 引用符付きの属性の変換 - loadXML(<<loadXML(<<Book title XML); + $xpath = new DOMXPath($doc); + $query = "//book[@name=" . DOMXPath::quote("'quoted' name") . "]"; echo $query, "\n"; + $entries = $xpath->query($query); + foreach ($entries as $entry) { echo "Found ", $entry->textContent, "\n"; } @@ -68,7 +72,7 @@ foreach ($entries as $entry) { &example.outputs; - @@ -77,7 +81,7 @@ Found Book title 引用符が混在している文字列もサポートします: - @@ -85,7 +89,7 @@ echo DOMXPath::quote("'different' \"quote\" styles"); &example.outputs; - @@ -121,4 +125,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> From 703ae5b664c8a419a39923c6ec5f1fcbc9223200 Mon Sep 17 00:00:00 2001 From: KentarouTakeda Date: Sun, 24 Nov 2024 23:01:23 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E8=A1=A8=E7=8F=BE=E3=81=AE=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/dom/domxpath/quote.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/dom/domxpath/quote.xml b/reference/dom/domxpath/quote.xml index fdfba76341..1eadc6f88c 100644 --- a/reference/dom/domxpath/quote.xml +++ b/reference/dom/domxpath/quote.xml @@ -46,7 +46,7 @@ &reftitle.examples; - 引用符付きの属性の変換 + 引用符を含む属性値の変換