From 2db999af088017ab5393f7e91e7e59eae8509d65 Mon Sep 17 00:00:00 2001 From: "SUMIDA, Ippei" Date: Sun, 24 Nov 2024 23:23:08 +0900 Subject: [PATCH] =?UTF-8?q?[PHP8.4]=20DOMXPath::quote()=E3=81=AE=E7=BF=BB?= =?UTF-8?q?=E8=A8=B3=20(#192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * DOMXPath::quote()の翻訳 * 改行とインデントを原文と揃える * 表現の調整 --------- Co-authored-by: 武田 憲太郎 --- reference/dom/domxpath/quote.xml | 128 +++++++++++++++++++++++++++++++ 1 file changed, 128 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..1eadc6f88c --- /dev/null +++ b/reference/dom/domxpath/quote.xml @@ -0,0 +1,128 @@ + + + + + + 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 + + + + +