-
Notifications
You must be signed in to change notification settings - Fork 83
[PHP8.4] DOMXPath::quote()の翻訳 #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- $Revision$ --> | ||
| <!-- EN-Revision: bac9d6a54fae363b3cc337bda924a76ff47e8851 Maintainer: Ippey Status: ready --> | ||
| <refentry xml:id="domxpath.quote" xmlns="http://docbook.org/ns/docbook"> | ||
| <refnamediv> | ||
| <refname>DOMXPath::quote</refname> | ||
| <refpurpose> | ||
| XPath 式で使用できるよう、文字列のまわりに引用符を付けます | ||
| </refpurpose> | ||
| </refnamediv> | ||
|
|
||
| <refsect1 role="description"> | ||
| &reftitle.description; | ||
| <methodsynopsis role="DOMXPath"> | ||
| <modifier>public</modifier> <modifier>static</modifier> <type>string</type><methodname>DOMXPath::quote</methodname> | ||
| <methodparam><type>string</type><parameter>str</parameter></methodparam> | ||
| </methodsynopsis> | ||
| <simpara> | ||
| XPath 式で使用できるよう、 <parameter>str</parameter> のまわりに引用符を付けます。 | ||
| </simpara> | ||
| </refsect1> | ||
|
|
||
| <refsect1 role="parameters"> | ||
| &reftitle.parameters; | ||
| <para> | ||
| <variablelist> | ||
| <varlistentry> | ||
| <term><parameter>str</parameter></term> | ||
| <listitem> | ||
| <simpara> | ||
| 引用符をつける文字列 | ||
| </simpara> | ||
| </listitem> | ||
| </varlistentry> | ||
| </variablelist> | ||
| </para> | ||
| </refsect1> | ||
|
|
||
| <refsect1 role="returnvalues"> | ||
| &reftitle.returnvalues; | ||
| <simpara> | ||
| XPath 式に使うことのできる引用符付きの文字列を返します。 | ||
| </simpara> | ||
| </refsect1> | ||
|
|
||
| <refsect1 role="examples"> | ||
| &reftitle.examples; | ||
| <example> | ||
| <title>引用符付きの属性の変換</title> | ||
| <programlisting role="php"> | ||
| <![CDATA[ | ||
| <?php | ||
| $doc = new DOMDocument; | ||
| $doc->loadXML(<<<XML | ||
| <books> | ||
| <book name="'quoted' name">Book title</book> | ||
| </books> | ||
| 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"; | ||
| } | ||
| ?> | ||
| ]]> | ||
| </programlisting> | ||
| &example.outputs; | ||
| <screen> | ||
| <![CDATA[ | ||
| //book[@name="'quoted' name"] | ||
| Found Book title | ||
| ]]> | ||
| </screen> | ||
| <simpara> | ||
| 引用符が混在している文字列もサポートします: | ||
| </simpara> | ||
| <programlisting role="php"> | ||
| <![CDATA[ | ||
| <?php | ||
| echo DOMXPath::quote("'different' \"quote\" styles"); | ||
| ?> | ||
| ]]> | ||
| </programlisting> | ||
| &example.outputs; | ||
| <screen> | ||
| <![CDATA[ | ||
| concat("'different' ",'"quote" styles') | ||
| ]]> | ||
| </screen> | ||
| </example> | ||
| </refsect1> | ||
|
|
||
| <refsect1 role="seealso"> | ||
| &reftitle.seealso; | ||
| <para> | ||
| <simplelist> | ||
| <member><methodname>DOMXPath::evaluate</methodname></member> | ||
| <member><methodname>DOMXPath::query</methodname></member> | ||
| </simplelist> | ||
| </para> | ||
| </refsect1> | ||
| </refentry> | ||
| <!-- Keep this comment at the end of the file | ||
| Local variables: | ||
| mode: sgml | ||
| sgml-omittag:t | ||
| sgml-shorttag:t | ||
| sgml-minimize-attributes:nil | ||
| sgml-always-quote-attributes:t | ||
| sgml-indent-step:1 | ||
| sgml-indent-data:t | ||
| indent-tabs-mode:nil | ||
| sgml-parent-document:nil | ||
| sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
| sgml-exposed-tags:nil | ||
| sgml-local-catalogs:nil | ||
| sgml-local-ecat-files:nil | ||
| End: | ||
| vim600: syn=xml fen fdm=syntax fdl=2 si | ||
| vim: et tw=78 syn=sgml | ||
| vi: ts=1 sw=1 | ||
| --> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここだけ、ちょっと意訳だとは思っています。他に良い言い回しあれば🙏
原文
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
気付いて頂いてありがとうございます。意訳というか、これ、原文の時点で不正確または曖昧な気がしますね…
これでにしてみます。意味としては正確なはず。
他に良いの思い浮かんだらいつでも仰ってください。