Skip to content

Commit ff70bdc

Browse files
committed
[reference/dom/*.xml, dom/attr/*.xml] sync with en
1 parent dde0a1b commit ff70bdc

30 files changed

+3095
-0
lines changed

reference/dom/dom/attr/isid.xml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: c1f37a6c270aadbbb3da56a3973ffd62197adf2b Maintainer: mumumu Status: ready -->
4+
<refentry xml:id="dom-attr.isid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
5+
<refnamediv>
6+
<refname>Dom\Attr::isId</refname>
7+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domattr.isid')/db:refnamediv/db:refpurpose)"/>
8+
</refnamediv>
9+
10+
<refsect1 role="description">
11+
&reftitle.description;
12+
<methodsynopsis role="Dom\\Attr">
13+
<modifier>public</modifier> <type>bool</type><methodname>Dom\Attr::isId</methodname>
14+
<void/>
15+
</methodsynopsis>
16+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domattr.isid')/db:refsect1[@role='description']/db:para[1])"/>
17+
<simpara>
18+
DOM 標準によると、属性ID を ID型 として定義する DTD が必要です。
19+
このメソッドを利用するには、
20+
オプションとして<constant>LIBXML_DTDVALID</constant>を渡して、
21+
解析時にドキュメントを検証しなければいけません。
22+
</simpara>
23+
</refsect1>
24+
25+
<refsect1 role="parameters">
26+
&reftitle.parameters;
27+
&no.function.parameters;
28+
</refsect1>
29+
30+
<refsect1 role="returnvalues">
31+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domattr.isid')/db:refsect1[@role='returnvalues']/*)">
32+
<xi:fallback/>
33+
</xi:include>
34+
</refsect1>
35+
36+
<refsect1 role="examples">
37+
&reftitle.examples;
38+
<example>
39+
<title>Dom\Attr::isId() の例</title>
40+
<programlisting role="php">
41+
<![CDATA[
42+
<?php
43+
44+
// We need to validate our document before referring to the id
45+
$doc = Dom\XMLDocument::createFromFile('examples/book-docbook.xml', LIBXML_DTDVALID);
46+
47+
// We retrieve the attribute named id of the chapter element
48+
$attr = $doc->getElementsByTagName('chapter')->item(0)->getAttributeNode('id');
49+
50+
var_dump($attr->isId()); // bool(true)
51+
52+
?>
53+
]]>
54+
</programlisting>
55+
</example>
56+
</refsect1>
57+
</refentry>
58+
<!-- Keep this comment at the end of the file
59+
Local variables:
60+
mode: sgml
61+
sgml-omittag:t
62+
sgml-shorttag:t
63+
sgml-minimize-attributes:nil
64+
sgml-always-quote-attributes:t
65+
sgml-indent-step:1
66+
sgml-indent-data:t
67+
indent-tabs-mode:nil
68+
sgml-parent-document:nil
69+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
70+
sgml-exposed-tags:nil
71+
sgml-local-catalogs:nil
72+
sgml-local-ecat-files:nil
73+
End:
74+
vim600: syn=xml fen fdm=syntax fdl=2 si
75+
vim: et tw=78 syn=sgml
76+
vi: ts=1 sw=1
77+
-->

reference/dom/dom/attr/rename.xml

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 2c9920402e11ecdc75f604e0d23c23fab1c75b74 Maintainer: mumumu Status: ready -->
4+
<refentry xml:id="dom-attr.rename" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5+
<refnamediv>
6+
<refname>Dom\Attr::rename</refname>
7+
<refpurpose>属性の名前空間または、修飾名を変更する</refpurpose>
8+
</refnamediv>
9+
10+
<refsect1 role="description">
11+
&reftitle.description;
12+
<methodsynopsis role="Dom\\Attr">
13+
<modifier>public</modifier> <type>void</type><methodname>Dom\Attr::rename</methodname>
14+
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>namespaceURI</parameter></methodparam>
15+
<methodparam><type>string</type><parameter>qualifiedName</parameter></methodparam>
16+
</methodsynopsis>
17+
<simpara>
18+
このメソッドは、属性の名前空間または、修飾名を変更します。
19+
</simpara>
20+
</refsect1>
21+
22+
<refsect1 role="parameters">
23+
&reftitle.parameters;
24+
<variablelist>
25+
<varlistentry>
26+
<term><parameter>namespaceURI</parameter></term>
27+
<listitem>
28+
<simpara>
29+
属性の新しい名前空間 <acronym>URI</acronym>
30+
</simpara>
31+
</listitem>
32+
</varlistentry>
33+
<varlistentry>
34+
<term><parameter>qualifiedName</parameter></term>
35+
<listitem>
36+
<simpara>
37+
属性の新しい修飾名
38+
</simpara>
39+
</listitem>
40+
</varlistentry>
41+
</variablelist>
42+
</refsect1>
43+
44+
<refsect1 role="returnvalues">
45+
&reftitle.returnvalues;
46+
<simpara>
47+
&return.void;
48+
</simpara>
49+
</refsect1>
50+
51+
<refsect1 role="errors">
52+
&reftitle.errors;
53+
<variablelist>
54+
<varlistentry>
55+
<term><constant>Dom\NAMESPACE_ERR</constant> 付きで <classname>DOMException</classname> が発生する場合</term>
56+
<listitem>
57+
<simpara>
58+
<parameter>qualifiedName</parameter> によって決まる名前空間にエラーがあった場合に発生します。
59+
</simpara>
60+
</listitem>
61+
</varlistentry>
62+
<varlistentry>
63+
<term><constant>Dom\INVALID_MODIFICATION_ERR</constant> 付きで <classname>DOMException</classname> が発生する場合</term>
64+
<listitem>
65+
<simpara>
66+
同じ修飾名を持つ要素中に、属性が存在すると発生します。
67+
</simpara>
68+
</listitem>
69+
</varlistentry>
70+
</variablelist>
71+
</refsect1>
72+
73+
<refsect1 role="examples">
74+
&reftitle.examples;
75+
<example xml:id="dom-attr.rename.example.basic">
76+
<title>名前空間と修飾名を両方変更する <methodname>Dom\Attr::rename</methodname> の例</title>
77+
<simpara>
78+
この例では、<literal>my-attr</literal> の修飾名を
79+
<literal>my-new-attr</literal> に変更します。
80+
その名前空間も <literal>urn:my-ns</literal> に変更します。
81+
</simpara>
82+
<programlisting role="php">
83+
<![CDATA[
84+
<?php
85+
86+
$doc = Dom\XMLDocument::createFromString('<root my-attr="value"/>');
87+
88+
$root = $doc->documentElement;
89+
$attribute = $root->attributes['my-attr'];
90+
$attribute->rename('urn:my-ns', 'my-new-attr');
91+
92+
echo $doc->saveXml();
93+
94+
?>
95+
]]>
96+
</programlisting>
97+
&example.outputs;
98+
<screen>
99+
<![CDATA[
100+
<?xml version="1.0" encoding="UTF-8"?>
101+
<root xmlns:ns1="urn:my-ns" ns1:my-new-attr="value"/>
102+
]]>
103+
</screen>
104+
</example>
105+
<example xml:id="dom-attr.rename.example.only-name">
106+
<title>修飾名だけを変更する <methodname>Dom\Attr::rename</methodname> の例</title>
107+
<simpara>
108+
この例では、<literal>my-attr</literal> の修飾名だけを変更します。
109+
名前空間 <acronym>URI</acronym> は元のままです。
110+
</simpara>
111+
<programlisting role="php">
112+
<![CDATA[
113+
<?php
114+
115+
$doc = Dom\XMLDocument::createFromString('<root my-attr="value"/>');
116+
117+
$root = $doc->documentElement;
118+
$attribute = $root->attributes['my-attr'];
119+
$attribute->rename($attribute->namespaceURI, 'my-new-attr');
120+
121+
echo $doc->saveXml();
122+
123+
?>
124+
]]>
125+
</programlisting>
126+
&example.outputs;
127+
<screen>
128+
<![CDATA[
129+
<?xml version="1.0" encoding="UTF-8"?>
130+
<root my-new-attr="value"/>
131+
]]>
132+
</screen>
133+
</example>
134+
</refsect1>
135+
136+
<refsect1 role="notes">
137+
&reftitle.notes;
138+
<note>
139+
<simpara>
140+
修飾名と名前空間 <acronym>URI</acronym> を一度にまとめて変更する必要がある場合があります。
141+
これは、名前空間の規則を壊さないようにするためです。
142+
</simpara>
143+
</note>
144+
</refsect1>
145+
146+
<refsect1 role="seealso">
147+
&reftitle.seealso;
148+
<simplelist>
149+
<member><methodname>Dom\Element::rename</methodname></member>
150+
</simplelist>
151+
</refsect1>
152+
153+
</refentry>
154+
<!-- Keep this comment at the end of the file
155+
Local variables:
156+
mode: sgml
157+
sgml-omittag:t
158+
sgml-shorttag:t
159+
sgml-minimize-attributes:nil
160+
sgml-always-quote-attributes:t
161+
sgml-indent-step:1
162+
sgml-indent-data:t
163+
indent-tabs-mode:nil
164+
sgml-parent-document:nil
165+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
166+
sgml-exposed-tags:nil
167+
sgml-local-catalogs:nil
168+
sgml-local-ecat-files:nil
169+
End:
170+
vim600: syn=xml fen fdm=syntax fdl=2 si
171+
vim: et tw=78 syn=sgml
172+
vi: ts=1 sw=1
173+
-->
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 89c7c070967be6bfca472840d1bcc9466f854283 Maintainer: mumumu Status: ready -->
4+
<reference xml:id="enum.dom-adjacentposition" role="enum" xmlns="http://docbook.org/ns/docbook">
5+
<title>Dom\AdjacentPosition Enum</title>
6+
<titleabbrev>Dom\AdjacentPosition</titleabbrev>
7+
8+
<partintro>
9+
<section xml:id="enum.dom-adjacentposition.intro">
10+
&reftitle.intro;
11+
<simpara>
12+
<enumname>AdjacentPosition</enumname> enum は、
13+
<methodname>Dom\Element::insertAdjacentElement</methodname> や
14+
<methodname>Dom\Element::insertAdjacentText</methodname> を使って、
15+
コンテキスト要素の相対位置として、どの位置に挿入を実行するかを指定するのに使います。
16+
</simpara>
17+
</section>
18+
19+
<section xml:id="enum.dom-adjacentposition.synopsis">
20+
&reftitle.enumsynopsis;
21+
22+
<enumsynopsis>
23+
<enumname>AdjacentPosition</enumname>
24+
25+
<enumitem>
26+
<enumidentifier>BeforeBegin</enumidentifier>
27+
<enumitemdescription>
28+
コンテキスト要素の前に挿入します。
29+
これは要素がドキュメントであり、存在する場合に限って使えます。
30+
</enumitemdescription>
31+
</enumitem>
32+
33+
<enumitem>
34+
<enumidentifier>AfterBegin</enumidentifier>
35+
<enumitemdescription>
36+
コンテキスト要素の最初の子の前に挿入します。
37+
</enumitemdescription>
38+
</enumitem>
39+
40+
<enumitem>
41+
<enumidentifier>BeforeEnd</enumidentifier>
42+
<enumitemdescription>
43+
コンテキスト要素の最後の子の後に挿入します。
44+
</enumitemdescription>
45+
</enumitem>
46+
47+
<enumitem>
48+
<enumidentifier>AfterEnd</enumidentifier>
49+
<enumitemdescription>
50+
コンテキスト要素の後に挿入します。
51+
これは要素がドキュメントであり、存在する場合に限って使えます。
52+
</enumitemdescription>
53+
</enumitem>
54+
55+
</enumsynopsis>
56+
</section>
57+
</partintro>
58+
</reference>
59+
<!-- Keep this comment at the end of the file
60+
Local variables:
61+
mode: sgml
62+
sgml-omittag:t
63+
sgml-shorttag:t
64+
sgml-minimize-attributes:nil
65+
sgml-always-quote-attributes:t
66+
sgml-indent-step:1
67+
sgml-indent-data:t
68+
indent-tabs-mode:nil
69+
sgml-parent-document:nil
70+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
71+
sgml-exposed-tags:nil
72+
sgml-local-catalogs:nil
73+
sgml-local-ecat-files:nil
74+
End:
75+
vim600: syn=xml fen fdm=syntax fdl=2 si
76+
vim: et tw=78 syn=sgml
77+
vi: ts=1 sw=1
78+
-->

0 commit comments

Comments
 (0)