Skip to content
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

[PHP 8.4] DOMNode::DOCUMENT_*定数とDOMNode::compareDocumentPositionに関する翻訳 #189

Merged
merged 7 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 139 additions & 3 deletions reference/dom/domnode.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 89ae180a851621c308f0ea4604ff2e919aa57a7f Maintainer: takagi Status: ready -->
<!-- Credits: mumumu -->
<!-- EN-Revision: 4b6c8a5a9469b5c02585618d5a6e0774ca37530f Maintainer: takagi Status: ready -->
<!-- Credits: mumumu,jdkfx -->
<reference xml:id="class.domnode" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>DOMNode クラス</title>
<titleabbrev>DOMNode</titleabbrev>
Expand All @@ -25,6 +25,50 @@
<classname>DOMNode</classname>
</ooclass>

<classsynopsisinfo role="comment">&Constants;</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="domnode.constants.document-position-disconnected">DOMNode::DOCUMENT_POSITION_DISCONNECTED</varname>
<initializer>1</initializer>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="domnode.constants.document-position-preceding">DOMNode::DOCUMENT_POSITION_PRECEDING</varname>
<initializer>2</initializer>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="domnode.constants.document-position-following">DOMNode::DOCUMENT_POSITION_FOLLOWING</varname>
<initializer>4</initializer>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="domnode.constants.document-position-contains">DOMNode::DOCUMENT_POSITION_CONTAINS</varname>
<initializer>8</initializer>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="domnode.constants.document-position-contained-by">DOMNode::DOCUMENT_POSITION_CONTAINED_BY</varname>
<initializer>16</initializer>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="domnode.constants.document-position-implementation-specific">DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC</varname>
<initializer>32</initializer>
</fieldsynopsis>

<classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
Expand Down Expand Up @@ -140,7 +184,74 @@
<!-- }}} -->

</section>


<section xml:id="domnode.constants">
&reftitle.constants;
<variablelist>
<varlistentry xml:id="domnode.constants.document-position-disconnected">
<term>
<constant>DOMNode::DOCUMENT_POSITION_DISCONNECTED</constant>
</term>
<listitem>
<simpara>
もう一方のノードと参照ノードが同じツリー内にない場合に設定されます。
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="domnode.constants.document-position-preceding">
<term>
<constant>DOMNode::DOCUMENT_POSITION_PRECEDING</constant>
</term>
<listitem>
<simpara>
もう一方のノードが参照ノードより前にある場合に設定されます。
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="domnode.constants.document-position-following">
<term>
<constant>DOMNode::DOCUMENT_POSITION_FOLLOWING</constant>
</term>
<listitem>
<simpara>
もう一方のノードが参照ノードの後に続く場合に設定されます。
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="domnode.constants.document-position-contains">
<term>
<constant>DOMNode::DOCUMENT_POSITION_CONTAINS</constant>
</term>
<listitem>
<simpara>
もう一方のノードが参照ノードの祖先である場合に設定されます。
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="domnode.constants.document-position-contained-by">
<term>
<constant>DOMNode::DOCUMENT_POSITION_CONTAINED_BY</constant>
</term>
<listitem>
<simpara>
もう一方のノードが参照ノードの子孫である場合に設定されます。
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="domnode.constants.document-position-implementation-specific">
<term>
<constant>DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC</constant>
</term>
<listitem>
<simpara>
結果が実装依存の動作に基づいており、移植性がない場合に設定されます。
これは、同じツリー内にないノードや属性ノードの場合に発生する可能性があります。
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>

<!-- {{{ DOMNode properties -->
<section xml:id="domnode.props">
&reftitle.properties;
Expand Down Expand Up @@ -292,6 +403,31 @@
</row>
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>
<methodname>DOMNode::compareDocumentPosition</methodname> メソッドが追加されました。
</entry>
</row>
<row>
<entry>8.4.0</entry>
<entry>
以下の定数が新たに追加されました。
<constant>DOMNode::DOCUMENT_POSITION_DISCONNECTED</constant>、
<constant>DOMNode::DOCUMENT_POSITION_PRECEDING</constant>、
<constant>DOMNode::DOCUMENT_POSITION_FOLLOWING</constant>、
<constant>DOMNode::DOCUMENT_POSITION_CONTAINS</constant>、
<constant>DOMNode::DOCUMENT_POSITION_CONTAINED_BY</constant>、および
<constant>DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC</constant>。
</entry>
</row>
<row>
<entry>8.3.0</entry>
<entry>
<methodname>DOMNode::contains</methodname> と、
<methodname>DOMNode::isEqualNode</methodname> というメソッドが追加されました。
</entry>
</row>
<row>
<entry>8.3.0</entry>
<entry>
Expand Down
98 changes: 98 additions & 0 deletions reference/dom/domnode/compareDocumentPosition.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: f1516b33abc82b59d0b8a52b973d64f4857939cc Maintainer: jdkfx Status: ready -->
<!-- CREDITS: jdkfx -->
<refentry xml:id="domnode.comparedocumentposition" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>DOMNode::compareDocumentPosition</refname>
<refpurpose>2つのノードの位置を比較します。</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="DOMNode">
<modifier>public</modifier> <type>int</type><methodname>DOMNode::compareDocumentPosition</methodname>
<methodparam><type>DOMNode</type><parameter>other</parameter></methodparam>
</methodsynopsis>
<simpara>
このノードに対するもう一方のノードの位置を比較します。
</simpara>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>other</parameter></term>
<listitem>
<para>
このノードに対して、位置を比較すべきノード。
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
<constant>DOMNode::DOCUMENT_POSITION_<replaceable>*</replaceable></constant> 定数のビットマスク。
</simpara>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example>
<title><methodname>DOMNode::compareDocumentPosition</methodname> の例</title>
<programlisting role="php">
<![CDATA[
<?php
$xml = <<<XML
<root>
<child1/>
<child2/>
</root>
XML;
$dom = new DOMDocument();
$dom->loadXML($xml);
$root = $dom->documentElement;
$child1 = $root->firstElementChild;
$child2 = $child1->nextElementSibling;
var_dump($root->compareDocumentPosition($child1));
var_dump($child2->compareDocumentPosition($child1));
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
int(20) // DOMNode::DOCUMENT_POSITION_CONTAINED_BY | DOMNode::DOCUMENT_POSITION_FOLLOWING 定数
int(2) // DOMNode::DOCUMENT_POSITION_PRECEDING 定数
]]>
</screen>
</example>
</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
-->