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 + + + + +