cvs: phpdoc /ja Translators /ja/functions domxml.xml

From: Date: Sun, 14 Apr 2002 14:05:44 +0000
Subject: cvs: phpdoc /ja Translators /ja/functions domxml.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969344380@lists.php.net to get a copy of this message
hirokawa Sun Apr 14 10:05:44 2002 EDT Modified files: /phpdoc/ja Translators /phpdoc/ja/functions domxml.xml Log: update translation.

Index: phpdoc/ja/Translators diff -u phpdoc/ja/Translators:1.33 phpdoc/ja/Translators:1.34 --- phpdoc/ja/Translators:1.33 Tue Jan 22 09:02:27 2002 +++ phpdoc/ja/Translators Sun Apr 14 10:05:43 2002 @@ -100,7 +100,7 @@ functions/mcal.xml Rui Hirokawa functions/mcrypt.xml Rui Hirokawa functions/mhash.xml Rui Hirokawa -functions/ming.xml Rui Hirokawa +functions/ming.xml Rui Hirokawa Translating functions/misc.xml Michihide Hotta functions/mnogosearch.xml Rui Hirokawa functions/msession.xml Rui Hirokawa @@ -150,7 +150,7 @@ functions/xmlrpc.xml Rui Hirokawa functions/xslt.xml Rui Hirokawa functions/yaz.xml Rui Hirokawa -functions/zlib.xml Rui Hirokawa +functions/zlib.xml Rui Hirokawa Translating -------- language ---------------------------------------------------------- language/basic-syntax.xml Rui Hirokawa language/constants.xml Rui Hirokawa Index: phpdoc/ja/functions/domxml.xml diff -u phpdoc/ja/functions/domxml.xml:1.15 phpdoc/ja/functions/domxml.xml:1.16 --- phpdoc/ja/functions/domxml.xml:1.15 Sat Feb 2 10:44:14 2002 +++ phpdoc/ja/functions/domxml.xml Sun Apr 14 10:05:43 2002 @@ -1,921 +1,2910 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.15 $ --> +<!-- $Revision: 1.16 $ --> <reference id="ref.domxml"> <title>DOM XML関数</title> <titleabbrev>DOM XML</titleabbrev> <partintro> - &warn.experimental; - <simpara> - このモジュールの関数は、configure時に - <option role="configure">--with-dom=[DIR]</option>を指定し、 - <ulink url="&url.domxml;">GNOME xmlライブラリ</ulink>を使用して構 - 築された場合にのみ利用可能です。少なくともlibxml-2.2.7が必要です。 - これらの関数は、PHP4で追加されました。 - </simpara> - <simpara> - 本モジュールによりXMLドキュメントをDOM APIにより操作することが可能 - になります。XMLドキュメント全体を PHPオブジェクトツリーに変換する - <function>xmltree</function>関数もサポートされます。現在、このツリー - は読み込みのみが可能であり、修正することはできません。しかし、 - <function>dumpmem</function> を適用することができないため、この制 - 約には意味がありません。このため、XMLファイルを読み込んで修正した - バージョンを書き込みたい場合には、<function>add_node</function>、 - <function>set_attribute</function>等を使用し、最後に - <function>dumpmem</function> 関数を使用して下さい。 - </simpara> - <simpara> - 本モジュールは、次の定数を定義します。 - </simpara> - <table> - <title>XML定数</title> - <tgroup cols="3"> - <thead> - <row> - <entry>定数</entry> - <entry>値</entry> - <entry>説明</entry> - </row> - </thead> - <tbody> - <row> - <entry>XML_ELEMENT_NODE</entry> - <entry>1</entry> - <entry>このノードはエレメントです</entry> - </row> - <row> - <entry>XML_ATTRIBUTE_NODE</entry> - <entry>2</entry> - <entry>このノードは属性です</entry> - </row> - <row> - <entry>XML_TEXT_NODE</entry> - <entry>3</entry> - <entry>このノードはテキスト部です</entry> - </row> - <row> - <entry>XML_CDATA_SECTION_NODE</entry> - <entry>4</entry> - <entry></entry> - </row> - <row> - <entry>XML_ENTITY_REF_NODE</entry> - <entry>5</entry> - <entry></entry> - </row> - <row> - <entry>XML_ENTITY_NODE</entry> - <entry>6</entry> - <entry>このノードは &amp;nbsp; のようなエンティティです</entry> - </row> - <row> - <entry>XML_PI_NODE</entry> - <entry>7</entry> - <entry>このノードは処理命令(PI)です</entry> - </row> - <row> - <entry>XML_COMMENT_NODE</entry> - <entry>8</entry> - <entry>このノードはコメントです</entry> - </row> - <row> - <entry>XML_DOCUMENT_NODE</entry> - <entry>9</entry> - <entry>このノードはドキュメントです</entry> - </row> - <row> - <entry>XML_DOCUMENT_TYPE_NODE</entry> - <entry>10</entry> - <entry></entry> - </row> - <row> - <entry>XML_DOCUMENT_FRAG_NODE</entry> - <entry>11</entry> - <entry></entry> - </row> - <row> - <entry>XML_NOTATION_NODE</entry> - <entry>12</entry> - <entry></entry> - </row> - <row> - <entry>XML_GLOBAL_NAMESPACE</entry> - <entry>1</entry> - <entry></entry> - </row> - <row> - <entry>XML_LOCAL_NAMESPACE</entry> - <entry>2</entry> - <entry></entry> - </row> - </tbody> - </tgroup> - </table> - <simpara> - 本モジュールの各関数は、2種類の方法で使用可能です。オブジェクト指 - 向的でない手法としては最初の引数としてオブジェクトを渡す方法があり、 - オブジェクト指向的な方法としては関数をオブジェクトのメソッドとして - コールする方法があります。本ドキュメントは、オブジェクト指向的でな - い関数を説明しますが、接頭辞 "domxml_" を省略することによりオブジェ - クト指向的メソッドを使用することが可能です。 - </simpara> - <simpara> - 本モジュールは、以下のテーブルに示す &mdash;プロパティおよびメソッ - ドを含む &mdash; 多くのクラスを定義します。 - </simpara> - <para> - <table> - <title>DomDocument クラス (メソッド)</title> - <tgroup cols="3"> - <thead> - <row> - <entry>メソッド名</entry> - <entry>関数名</entry> - <entry>説明</entry> - </row> - </thead> - <tbody> - <row> - <entry>root</entry> - <entry><function>domxml_root</function></entry> - <entry></entry> - </row> - <row> - <entry>children</entry> - <entry><function>domxml_children</function></entry> - <entry></entry> - </row> - <row> - <entry>add_root</entry> - <entry><function>domxml_add_root</function></entry> - <entry></entry> - </row> - <row> - <entry>dtd</entry> - <entry><function>domxml_intdtd</function></entry> - <entry></entry> - </row> - <row> - <entry>dumpmem</entry> - <entry><function>domxml</function></entry> - <entry></entry> - </row> - <row> - <entry>xpath_init</entry> - <entry>xpath_init</entry> - <entry></entry> - </row> - <row> - <entry>xpath_new_context</entry> - <entry>xpath_new_context</entry> - <entry></entry> - </row> - <row> - <entry>xptr_new_context</entry> - <entry>xptr_new_context</entry> - <entry></entry> - </row> - </tbody> - </tgroup> - </table> - </para> - - <para> - <table> - <title>DomDocument クラス (属性)</title> - <tgroup cols="3"> - <thead> - <row> - <entry>名前</entry> - <entry>型</entry> - <entry>説明</entry> - </row> - </thead> - <tbody> - <row> - <entry>doc</entry> - <entry>class DomDocument</entry> - <entry>オブジェクト自身</entry> - </row> - <row> - <entry>name</entry> - <entry>string</entry> - <entry></entry> - </row> - <row> - <entry>url</entry> - <entry>string</entry> - <entry></entry> - </row> - <row> - <entry>version</entry> - <entry>string</entry> - <entry>XMLのバージョン</entry> - </row> - <row> - <entry>encoding</entry> - <entry>string</entry> - <entry></entry> - </row> - <row> - <entry>standalone</entry> - <entry>long</entry> - <entry>このファイルがstandaloneバージョンの場合に1</entry> - </row> - <row> - <entry>type</entry> - <entry>long</entry> - <entry>表中の定数のどれか ... </entry> - </row> - <row> - <entry>compression</entry> - <entry>long</entry> - <entry>このファイルが圧縮されている場合に1</entry> - </row> - <row> - <entry>charset</entry> - <entry>long</entry> - <entry></entry> - </row> - </tbody> - </tgroup> - </table> - </para> - - <para> - <table> - <title>DomNode class (メソッド)</title> - <tgroup cols="3"> - <thead> - <row> - <entry>名前</entry> - <entry>PHP名</entry> - <entry>説明</entry> - </row> - </thead> - <tbody> - <row> - <entry>lastchild</entry> - <entry><function>domxml_last_child</function></entry> - <entry></entry> - </row> - <row> - <entry>children</entry> - <entry><function>domxml_children</function></entry> - <entry></entry> - </row> - <row> - <entry>parent</entry> - <entry><function>domxml_parent</function></entry> - <entry></entry> - </row> - <row> - <entry>new_child</entry> - <entry><function>domxml_new_child</function></entry> - <entry></entry> - </row> - <row> - <entry>get_attribute</entry> - <entry><function>domxml_get_attribute</function></entry> - <entry></entry> - </row> - <row> - <entry>set_attribute</entry> - <entry><function>domxml_set_attribute</function></entry> - <entry></entry> - </row> - <row> - <entry>attributes</entry> - <entry><function>domxml_attributes</function></entry> - <entry></entry> - </row> - <row> - <entry>node</entry> - <entry><function>domxml_node</function></entry> - <entry></entry> - </row> - <row> - <entry><function>set_content</function></entry> - <entry>domxml_set_content</entry> - <entry></entry> - </row> - </tbody> - </tgroup> - </table> - </para> - - <para> - <table> - <title>DomNode クラス (属性)</title> - <tgroup cols="3"> - <thead> - <row> - <entry>名前</entry> - <entry>型</entry> - <entry>説明</entry> - </row> - </thead> - <tbody> - <row> - <entry>node</entry> - <entry>class DomNode</entry> - <entry>オブジェクト自身</entry> - </row> - <row> - <entry>type</entry> - <entry>long</entry> - <entry></entry> - </row> - <row> - <entry>name</entry> - <entry>string</entry> - <entry></entry> - </row> - <row> - <entry>content</entry> - <entry>string</entry> - <entry></entry> - </row> - </tbody> - </tgroup> - </table> - </para> + <sect1 id="domxml-intro"> + <title>はじめに</title> + &warn.experimental; + <para> + domxml拡張モジュールは、DOM標準に対する互換性を改善するためPHPバー + ジョン4.3.0で書き直されました。拡張モジュールには、まだ、多くの古 + い関数が含まれていますが、使用は推奨されません。特にオブジェクト + 指向でない関数の使用は避けるべきです。 + </para> + <para> + 拡張モジュールによりDOM APIでXMLドキュメントを処理することが可能 + となります。また、完全なXMLドキュメントをPHPオブジェクトツリーに + 変換する関数<function>domxml_xmltree</function>も提供されています。 + 現在、このツリーは読み込み可とされています。このツリーを修正する + ことは可能ですが、<function>DomDocument_dump_mem</function>にこれ + を適用することはできないため、意味はありません。 + そこで、XMLファイルを読み込み、修正した版を書き込みたい場合、 + <function>DomDocument_create_element</function>, + <function>DomDocument_create_text</function>, + <function>set_attribute</function>等を使用し、最後に + <function>DomDocument_dump_mem</function>関数を使用して下さい。 + </para> + </sect1> + + <sect1 id="domxml-requirements"> + <title>必要なもの</title> + <para> + この拡張モジュールは、PHPのconfigureが + <ulink url="&url.domxml;">GNOME XMLライブラリ</ulink>を用いて + <option role="configure">--with-dom=[DIR]</option>を指定して + 実行されている場合のみ利用可能です。libxml-2.2.7以降が必要です。 + </para> + </sect1> + + <sect1 id="domxml-deprecated"> + <title>古い関数</title> + <para> + <table> + <title>古い関数とその代替関数</title> + <tgroup cols="2"> + <thead> + <row> + <entry>古い関数</entry> + <entry>新しい関数</entry> + </row> + </thead> + <tbody> + <row> + <entry>xmldoc</entry> + <entry><function>domxml_open_mem</function></entry> + </row> + <row> + <entry>xmldocfiel</entry> + <entry><function>domxml_open_file</function></entry> + </row> + <row> + <entry>domxml_new_xmldoc</entry> + <entry><function>domxml_new_doc</function></entry> + </row> + <row> + <entry>domxml_dump_mem</entry> + <entry><function>DomDocument_dump_mem</function></entry> + </row> + <row> + <entry>domxml_dump_mem_file</entry> + <entry><function>DomDocument_dump_file</function></entry> + </row> + <row> + <entry>DomDocument_dump_mem_file</entry> + <entry><function>DomDocument_dump_file</function></entry> + </row> + <row> + <entry>DomDocument_add_root</entry> + <entry> + <function>DomDocument_create_element</function>の後に + <function>DomNode_append_child</function> + </entry> + </row> + <row> + <entry>DomDocument_dtd</entry> + <entry><function>DomDocument_doctype</function></entry> + </row> + <row> + <entry>DomDocument_root</entry> + <entry><function>DomDocument_document_element</function></entry> + </row> + <row> + <entry>DomDocument_children</entry> + <entry><function>DomNode_child_nodes</function></entry> + </row> + <row> + <entry>DomDocument_imported_node</entry> + <entry>No replacement.</entry> + </row> + <row> + <entry>DomNode_add_child</entry> + <entry> + Create a new node with e.g. + <function>DomDocument_create_element</function> und add it with + <function>DomNode_append_child</function>. + </entry> + </row> + <row> + <entry>DomNode_children</entry> + <entry><function>DomNode_child_nodes</function></entry> + </row> + <row> + <entry>DomNode_parent</entry> + <entry><function>DomNode_parent_node</function></entry> + </row> + <row> + <entry>DomNode_new_child</entry> + <entry> + 例えば<function>DomDocument_create_element</function>で + 新規ノードを作成し、 + <function>DomNode_append_child</function>で追加します。 + </entry> + </row> + <row> + <entry>DomNode_set_content</entry> + <entry> + 例えば<function>DomDocument_create_element</function>で + 新規ノードを作成し、 + <function>DomNode_append_child</function>で追加します。 + </entry> + </row> + <row> + <entry>DomNode_get_content</entry> + <entry> + コンテンツはテキストノードであり、 + <function>DomNode_child_nodes</function>でアクセス可能です。 + </entry> + </row> + <row> + <entry>DomNode_set_content</entry> + <entry> + コンテンツはテキストノードであり、 + <function>DomNode_append_child</function>で追加できます。 + </entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </sect1> + + <sect1 id="domxml-constants"> + <title>定数</title> + <para> + このモジュールは、以下の定数を定義します。 + </para> + <table> + <title>XML定数</title> + <tgroup cols="3"> + <thead> + <row> + <entry>定数</entry> + <entry>値</entry> + <entry>説明</entry> + </row> + </thead> + <tbody> + <row> + <entry>XML_ELEMENT_NODE</entry> + <entry>1</entry> + <entry>ノードは要素(element)である</entry> + </row> + <row> + <entry>XML_ATTRIBUTE_NODE</entry> + <entry>2</entry> + <entry>ノードは属性(attribute)である</entry> + </row> + <row> + <entry>XML_TEXT_NODE</entry> + <entry>3</entry> + <entry>ノードはテキストの一部である</entry> + </row> + <row> + <entry>XML_CDATA_SECTION_NODE</entry> + <entry>4</entry> + <entry></entry> + </row> + <row> + <entry>XML_ENTITY_REF_NODE</entry> + <entry>5</entry> + <entry></entry> + </row> + <row> + <entry>XML_ENTITY_NODE</entry> + <entry>6</entry> + <entry>ノードは&amp;nbsp;のようなエンティティである</entry> + </row> + <row> + <entry>XML_PI_NODE</entry> + <entry>7</entry> + <entry>ノードは処理命令(PI)である</entry> + </row> + <row> + <entry>XML_COMMENT_NODE</entry> + <entry>8</entry> + <entry>ノードはコメントである</entry> + </row> + <row> + <entry>XML_DOCUMENT_NODE</entry> + <entry>9</entry> + <entry>ノードはドキュメントである</entry> + </row> + <row> + <entry>XML_DOCUMENT_TYPE_NODE</entry> + <entry>10</entry> + <entry></entry> + </row> + <row> + <entry>XML_DOCUMENT_FRAG_NODE</entry> + <entry>11</entry> + <entry></entry> + </row> + <row> + <entry>XML_NOTATION_NODE</entry> + <entry>12</entry> + <entry></entry> + </row> + <row> + <entry>XML_GLOBAL_NAMESPACE</entry> + <entry>1</entry> + <entry></entry> + </row> + <row> + <entry>XML_LOCAL_NAMESPACE</entry> + <entry>2</entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </sect1> + + <sect1 id="domxml-classes"> + <title>クラス</title> + <para> + モジュールのAPIは、DOMレベル2標準に可能な限り基づいています。結果 + 的にAPIは完全にオブジェクト指向です。このモジュールを使用する際に + DOM標準が利用できることは望ましいことです。 + このAPIはオブジェクト指向ですが、最初の引数として処理するオブジェ + クトを渡すオブジェクト指向でない方法でコールすることができる多く + の関数があります。これらの関数は、主に過去のバージョンとの互換性 + 確保のために維持されていますが、新規開発での使用はもはや推奨され + ません。 + </para> + <para> + このAPIは、公式なDOM APIとは二つの点で異なっています。まず、全て + のクラスの属性は、同じ名前を有する関数として実装され、関数名はPHP + の命名表記に基づいています。これは、DOM関数lastChild()が + last_child()と書かれることを意味します。 + </para> + <para> + このモジュールは、一連のクラスを定義します。メソッドも含めたリス + トを以下の表に示します。クラスは、DOM標準でDOMxxxという名前のもの + と等価です。 + </para> + + <para> + <table> + <title>クラスの一覧</title> + <tgroup cols="2"> + <thead> + <row> + <entry>クラス名</entry> + <entry>親クラス</entry> + </row> + </thead> + <tbody> + <row> + <entry>DomAttribute</entry> + <entry>DomNode</entry> + </row> + <row> + <entry>DomCData</entry> + <entry>DomNode</entry> + </row> + <row> + <entry>DomComment</entry> + <entry>DomCData : DomNode</entry> + </row> + <row> + <entry>DomDocument</entry> + <entry>DomNode</entry> + </row> + <row> + <entry>DomDocumentType</entry> + <entry>DomNode</entry> + </row> + <row> + <entry>DomElement</entry> + <entry>DomNode</entry> + </row> + <row> + <entry>DomEntity</entry> + <entry>DomNode</entry> + </row> + <row> + <entry>DomEntityReference</entry> + <entry>DomNode</entry> + </row> + <row> + <entry>DomProcessingInstruction</entry> + <entry>DomNode</entry> + </row> + <row> + <entry>DomText</entry> + <entry>DomCData : DomNode</entry> + </row> + <row> + <entry>Parser</entry> + <entry>現在はまだDomParserと呼ばれています</entry> + </row> + <row> + <entry>XPathContext</entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>DomDocument クラス (DomDocument : DomNode)</title> + <tgroup cols="3"> + <thead> + <row> + <entry>メソッド名</entry> + <entry>関数名</entry> + <entry>注意</entry> + </row> + </thead> + <tbody> + <row> + <entry>doctype</entry> + <entry><function>DomDocument_doctype</function></entry> + <entry></entry> + </row> + <row> + <entry>document_elemnent</entry> + <entry><function>DomDocument_document_element</function></entry> + <entry></entry> + </row> + <row> + <entry>create_element</entry> + <entry><function>DomDocument_create_element</function></entry> + <entry></entry> + </row> + <row> + <entry>create_text_node</entry> + <entry><function>DomDocument_create_text_node</function></entry> + <entry></entry> + </row> + <row> + <entry>create_comment</entry> + <entry><function>DomDocument_create_comment</function></entry> + <entry></entry> + </row> + <row> + <entry>create_cdata_section</entry> + <entry><function>DomDocument_create_cdata_section</function></entry> + <entry></entry> + </row> + <row> + <entry>create_processing_instruction</entry> + <entry><function>DomDocument_create_processing_instruction</function></entry> + <entry></entry> + </row> + <row> + <entry>create_attribute</entry> + <entry><function>DomDocument_create_attribute</function></entry> + <entry></entry> + </row> + <row> + <entry>create_entity_reference</entry> + <entry><function>DomDocument_create_entity_reference</function></entry> + <entry></entry> + </row> + <row> + <entry>get_elements_by_tagname</entry> + <entry><function>DomDocument_get_elements_by_tagname</function></entry> + <entry></entry> + </row> + <row> + <entry>get_element_by_id</entry> + <entry><function>DomDocument_get_element_by_id</function></entry> + <entry></entry> + </row> + <row> + <entry>dump_mem</entry> + <entry><function>DomDocument_dump_mem</function></entry> + <entry>DOM標準ではない</entry> + </row> + <row> + <entry>dump_file</entry> + <entry><function>DomDocument_dump_file</function></entry> + <entry>DOM標準ではない</entry> + </row> + <row> + <entry>html_dump_mem</entry> + <entry><function>DomDocument_html_dump_mem</function></entry> + <entry>DOM標準ではない</entry> + </row> + <row> + <entry>xpath_init</entry> + <entry>xpath_init</entry> + <entry>DOM標準ではない</entry> + </row> + <row> + <entry>xpath_new_context</entry> + <entry>xpath_new_context</entry> + <entry>DOM標準ではない</entry> + </row> + <row> + <entry>xptr_new_context</entry> + <entry>xptr_new_context</entry> + <entry>DOM標準ではない</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>DomElement クラス (DomElement : DomNode)</title> + <tgroup cols="3"> + <thead> + <row> + <entry>メソッド名</entry> + <entry>関数名</entry> + <entry>注意</entry> + </row> + </thead> + <tbody> + <row> + <entry>tagname</entry> + <entry><function>DomElement_tagname</function></entry> + <entry></entry> + </row> + <row> + <entry>get_attribute</entry> + <entry><function>DomElement_get_attribute</function></entry> + <entry></entry> + </row> + <row> + <entry>set_attribute</entry> + <entry><function>DomElement_set_attribute</function></entry> + <entry></entry> + </row> + <row> + <entry>remove_attribute</entry> + <entry><function>DomElement_remove_attribute</function></entry> + <entry></entry> + </row> + <row> + <entry>get_attribute_node</entry> + <entry><function>DomElement_get_attribute_node</function></entry> + <entry></entry> + </row> + <row> + <entry>set_attribute_node</entry> + <entry><function>DomElement_set_attribute_node</function></entry> + <entry></entry> + </row> + <row> + <entry>get_elements_by_tagname</entry> + <entry><function>DomElement_get_elements_by_tagname</function></entry> + <entry></entry> + </row> + <row> + <entry>has_attribute</entry> + <entry><function>DomElement_has_attribute</function></entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>DomNode クラス</title> + <tgroup cols="2"> + <thead> + <row> + <entry>メソッド名</entry> + <entry>注意</entry> + </row> + </thead> + <tbody> + <row> + <entry><function>DomNode_node_name</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_node_value</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_node_type</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_last_child</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_first_child</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_child_nodes</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_previous_sibling</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_next_sibling</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_parent_node</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_owner_document</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_insert_before</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_append_child</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_remove_child</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_has_child_nodes</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_has_attributes</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_clone_node</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_attributes</function></entry> + <entry></entry> + </row> + <row> + <entry><function>DomNode_unlink_node</function></entry> + <entry>DOM標準ではない</entry> + </row> + <row> + <entry><function>DomNode_replace_node</function></entry> + <entry>DOM標準ではない</entry> + </row> + <row> + <entry><function>DomNode_set_content</function></entry> + <entry>DOM標準にはなく、古いメソッドです</entry> + </row> + <row> + <entry><function>DomNode_get_content</function></entry> + <entry>DOM標準にはなく、古いメソッドです</entry> + </row> + <row> + <entry><function>DomNode_dump_node</function></entry> + <entry>DOM標準ではない</entry> + </row> + <row> + <entry><function>DomNode_is_blank_node</function></entry> + <entry>DOM標準ではない</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>DomAttribute クラス (DomAttribute : DomNode)</title> + <tgroup cols="3"> + <thead> + <row> + <entry>メソッド名</entry> + <entry></entry> + <entry>注意</entry> + </row> + </thead> + <tbody> + <row> + <entry>name</entry> + <entry><function>DomAttribute_name</function></entry> + <entry></entry> + </row> + <row> + <entry>value</entry> + <entry><function>DomAttribute_value</function></entry> + <entry></entry> + </row> + <row> + <entry>specified</entry> + <entry><function>DomAttribute_specified</function></entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>DomProcessingInstruction クラス (DomProcessingInstruction : DomNode)</title> + <tgroup cols="3"> + <thead> + <row> + <entry>メソッド名</entry> + <entry>関数名</entry> + <entry>注意</entry> + </row> + </thead> + <tbody> + <row> + <entry>target</entry> + <entry><function>DomProcessingInstruction_target</function></entry> + <entry></entry> + </row> + <row> + <entry>data</entry> + <entry><function>DomProcessingInstruction_data</function></entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>Parser クラス</title> + <tgroup cols="3"> + <thead> + <row> + <entry>メソッド名</entry> + <entry>関数名</entry> + <entry>注記</entry> + </row> + </thead> + <tbody> + <row> + <entry>add_chunk</entry> + <entry><function>Parser_add_chunk</function></entry> + <entry></entry> + </row> + <row> + <entry>end</entry> + <entry><function>Parser_end</function></entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>XPathContext クラス</title> + <tgroup cols="3"> + <thead> + <row> + <entry>メソッド名</entry> + <entry>関数名</entry> + <entry>注記</entry> + </row> + </thead> + <tbody> + <row> + <entry>eval</entry> + <entry><function>XPathContext_eval</function></entry> + <entry></entry> + </row> + <row> + <entry>eval_expression</entry> + <entry><function>XPathContext_eval_expression</function></entry> + <entry></entry> + </row> + <row> + <entry>register_ns</entry> + <entry><function>XPathContext_register_ns</function></entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>DomDocumentType クラス (DomDocumentType : DomNode)</title> + <tgroup cols="3"> + <thead> + <row> + <entry>メソッド名</entry> + <entry>関数名</entry> + <entry>注記</entry> + </row> + </thead> + <tbody> + <row> + <entry>name</entry> + <entry><function>DomDocumentType_name</function></entry> + <entry></entry> + </row> + <row> + <entry>entities</entry> + <entry><function>DomDocumentType_entities</function></entry> + <entry></entry> + </row> + <row> + <entry>notations</entry> + <entry><function>DomDocumentType_notations</function></entry> + <entry></entry> + </row> + <row> + <entry>public_id</entry> + <entry><function>DomDocumentType_public_id</function></entry> + <entry></entry> + </row> + <row> + <entry>system_id</entry> + <entry><function>DomDocumentType_system_id</function></entry> + <entry></entry> + </row> + <row> + <entry>internal_subset</entry> + <entry><function>DomDocumentType_internal_subset</function></entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + クラスDomDtdはDomNodeから派生したものです。DomCommentはDomCDataか + ら派生したものです。 + </para> + </sect1> + + <sect1 id="domxml-examples"> + <title>例</title> + <para> + このリファレンスにおける多くの例は、XML文字列を必要とします。この + 文字列を全ての例で繰りかえし記述するかわりに、ファイルに書き込ん + で、各例で読み込むことにします。この読み込まれるファイルは、以下 + の例に示されています。XMLドキュメントを作成し、 + <function>DomDocument_open_file</function>で読み込むことも可能で + す。 + </para> + <para> + <example> + <title>XML文字列を有するファイルexample.incを読み込む</title> + <programlisting role="php"> +<![CDATA[ +<?php +$xmlstr = "<?xml version='1.0' standalone='yes'?> +<!DOCTYPE chapter SYSTEM '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd' +[ <!ENTITY sp \"spanish\"> +]> +<!-- lsfj --> +<chapter language='en'><title language='en'>Title</title> + <para language='ge'> + &amp;sp; + <!-- comment --> + <informaltable ID='findme' language='&amp;sp;'> + <tgroup cols='3'> + <tbody> + <row><entry>a1</entry><entry +morerows='1'>b1</entry><entry>c1</entry></row> +<row><entry>a2</entry><entry>c2</entry></row> + <row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row> + </tbody> + </tgroup> + </informaltable> + </para> +</chapter>"; +?> +]]> + </programlisting> + </example> + </para> + </sect1> </partintro> - <!-- class Dom document --> - <!-- has member functions - array root([int doc_handle]) - returns array of root nodes of this document. Array - elements are objects of class "Dom node" having properties of - "node" (resource), "type" (long), "name" (string) - and optionally "content" (string). - - array children([ int node ]) - returns an array of child nodes of this element. Array - elements are objects of class "Dom node" having properties - of "node" (resource), "type" (long), "name" (string) - and optionally "content" (string). - - object add_root([int doc_handle,] string name) - Add a root node to document. - - returns an object of class "Dom node" having properties - of "node" (resource), "type" (long), "name" (string) - and optionally "content" (string). - - object intdtd([int doc_handle]) - returns the DTD of document. - - returns an object of class "Dtd" having properties - of "dtd" (resource), "sysid" (string), "name" (string) - and optionally "extid" (string). - - string dumpmem([int doc_handle]) - dumps document into string. - --> - - <!-- class Dom node - object lastchild([int node]) - returns Dom node object - - array children([int node]) - as above - - object parent([ int node]) - returns Dom node object - (parent of this node) - - new_child - string getattr([int node,] string attrname) - get value of attribute named attrname - - bool setattr([int node,] string attrname, string value) - set value of given attribute. - - array attributes([int node]) - returns associative array of (string name, string value) - pairs. - - object node(string name) - creates a named Dom node object. - --> - - <!-- class Dom Attribute - name - --> - - <!-- class Dom Namespace - --> + <refentry id="function.domxml-open-mem"> + <refnamediv> + <refname>domxml_open_mem</refname> + <refpurpose>XMLドキュメントからDOMオブジェクトを作成する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>domxml_open_mem</methodname> + <methodparam><type>string</type><parameter>str</parameter></methodparam> + </methodsynopsis> + <para> + この関数は、<parameter>str</parameter>のXMLドキュメントをパースし、 + クラス"Dom document"のオブジェクトを返します。 + このオブジェクトは、上のリストを示したプロパティを有しています。 + この関数、<function>domxml_open_file</function>、 + <function>domxml_new_doc</function>は、全ての他の関数をコールする + 前にコールする必要があります。 + </para> + <para> + <example> + <title>文字列からXMLドキュメントをオープンする</title> + <programlisting role="php"> +<![CDATA[ +<?php +include("example.inc"); + +if(!$dom = domxml_open_mem($xmlstr)) { + echo "Error while parsing the document\n"; + exit; +} + +$root = $dom->document_element(); +?> +]]> + </programlisting> + </example> + </para> + <para> + <function>domxml_open_file</function>, + <function>domxml_new_doc</function>も参照下さい。 + </para> + </refsect1> + </refentry> + + <refentry id="function.domxml-open-file"> + <refnamediv> + <refname>domxml_open_file</refname> + <refpurpose>XMLファイルからDOMオブジェクトを作成する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>domxml_open_file</methodname> + <methodparam><type>string</type> + <parameter>filename</parameter> + </methodparam> + </methodsynopsis> + <para> + この関数は、<parameter>filename</parameter>という名前のファイルの + 中のXMLドキュメントをパースし、クラス"Dom document"のオブジェクト + を返します。このオブジェクトは上記リストと同じプロパティを有しま + す。ファイルは、読み込みのみ可でアクセスされます。 + </para> + <para> + <example> + <title>ファイルからXMLドキュメントをオープンする</title> + <programlisting role="php"> +<![CDATA[ +<?php + +if(!$dom = domxml_open_file("example.xml")) { + echo "Error while parsing the document\n"; + exit; +} + +$root = $dom->document_element(); +?> +]]> + </programlisting> + </example> + </para> + <para> + <function>domxml_open_mem</function>, + <function>domxml_new_doc</function>も参照下さい。 + </para> + </refsect1> + </refentry> + + <refentry id="function.domxml-new-doc"> + <refnamediv> + <refname>domxml_new_doc</refname> + <refpurpose> + 空のXMLドキュメントを作成する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>domxml_new_doc</methodname> + <methodparam><type>string</type> + <parameter>version</parameter> + </methodparam> + </methodsynopsis> + &warn.experimental.func; + <para> + スクラッチから新規DOMドキュメントを作成し、返します。 + </para> + <para> + <function>DomDocument_add_root</function>も参照下さい。 + </para> + </refsect1> + </refentry> + + <refentry id="function.domxml-xmltree"> + <refnamediv> + <refname>domxml_xmltree</refname> + <refpurpose> + XMLドキュメントからPHPオブジェクトツリーを作成する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>domxml_xmltree</methodname> + <methodparam><type>string</type><parameter>str</parameter></methodparam> + </methodsynopsis> + &warn.experimental.func; + <para> + この関数は、<parameter>str</parameter>のXMLドキュメントをパースし、 + パース済のドキュメントとしてPHPオブジェクトのツリーを返します。他 + の関数はこのツリーにはアクセスできないため、この関数は他の関数と + 異なっています。例えばノードを追加する時のように、このツリーを修 + 正することには、現在XMLファイルとしてツリーをダンプする手段がない + ため意味がありません。この関数は、ファイルを読み込んで定数を調べ + たい場合には有用です。 + </para> + </refsect1> + </refentry> + + <refentry id='function.domxml-version'> + <refnamediv> + <refname>domxml_version</refname> + <refpurpose> + XMLライブラリのバージョンを取得する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>domxml_version</methodname> + <void/> + </methodsynopsis> + <para> + この関数は、現在使用されるXMLライブラリのバージョンを返します。 + </para> + </refsect1> + </refentry> + + <!-- Start of class DomDocument --> + + <refentry id="function.DomDocument-doctype"> + <refnamediv> + <refname>DomDocument->doctype</refname> + <refpurpose> + ドキュメント型を返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomDocument->doctype</methodname> + <void/> + </methodsynopsis> + <para> + この関数は、クラス<classname>DomDocumentType</classname>のオブジェ + クトを返します。4.3より前のバージョンのPHPでは、このオブジェクト + は、クラス<classname>Dtd</classname>でしたが、DOM標準にはそのよう + なクラスはありません。 + </para> + <para> + クラス<classname>DomDocumentType</classname>のメソッドも参照下さ + い。 + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-document-element"> + <refnamediv> + <refname>DomDocument->document_element</refname> + <refpurpose> + ルートエレメントノードを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomDocument->document_element</methodname> + <void/> + </methodsynopsis> + <para> + This function returns the root element node of a document. + </para> + <para> + The following example returns just the element with name CHAPTER and + prints it. The other node -- the comment -- is not returned. + <example> + <title>Retrieving root element</title> + <programlisting role="php"> +<![CDATA[ +<?php +include("example.inc"); + +if(!$dom = domxml_open_mem($xmlstr)) { + echo "Error while parsing the document\n"; + exit; +} + +$root = $dom->document_element(); +print_r($root); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-create-element"> + <refnamediv> + <refname>DomDocument->create_element</refname> + <refpurpose> + 新規エレメントノードを作成する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomDocument->create_element</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + This function returns a new instance of class + <classname>DomElement</classname>. The tag name of the element is the + value of the passed parameter. This node will not show up in the + document unless it is inserted with e.g. + <function>DomNode_append_child</function>. + </para> + <para> + The return value is false if an error occured. + </para> + <para> + See also <function>DomNode_append_child</function>, + <function>DomDocument_create_text</function>, + <function>DomDocument_create_comment</function>, + <function>DomDocument_create_attribute</function>, + <function>DomDocument_create_processing_instruction</function>, + <function>DomDocument_create_entity_reference</function>, + <function>DomNode_insert_before</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-create-text-node"> + <refnamediv> + <refname>DomDocument->create_text_node</refname> + <refpurpose> + 新規テキストノードを作成する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomDocument->create_text_node</methodname> + <methodparam><type>string</type><parameter>content</parameter></methodparam> + </methodsynopsis> + <para> + This function returns a new instance of class + <classname>DomText</classname>. The content of the text is the value of + the passed + parameter. This node will not show up in the + document unless it is inserted with e.g. + <function>DomNode_append_child</function>. + </para> + <para> + The return value is false if an error occured. + </para> + <para> + See also <function>DomNode_append_child</function>, + <function>DomDocument_create_element</function>, + <function>DomDocument_create_comment</function>, + <function>DomDocument_create_text</function>, + <function>DomDocument_create_attribute</function>, + <function>DomDocument_create_processing_instruction</function>, + <function>DomDocument_create_entity_reference</function>, + <function>DomNode_insert_before</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-create-comment"> + <refnamediv> + <refname>DomDocument->create_comment</refname> + <refpurpose> + 新規コメントノードを作成する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomDocument->create_comment</methodname> + <methodparam><type>string</type><parameter>content</parameter></methodparam> + </methodsynopsis> + <para> + This function returns a new instance of class + <classname>DomComment</classname>. The content of the comment is the + value of the passed parameter. This node will not show up in the + document unless it is inserted with e.g. + <function>DomNode_append_child</function>. + </para> + <para> + The return value is false if an error occured. + </para> + <para> + See also <function>DomNode_append_child</function>, + <function>DomDocument_create_element</function>, + <function>DomDocument_create_text</function>, + <function>DomDocument_create_attribute</function>, + <function>DomDocument_create_processing_instruction</function>, + <function>DomDocument_create_entity_reference</function>, + <function>DomNode_insert_before</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-create-cdata-section"> + <refnamediv> + <refname>DomDocument->create_cdata_section</refname> + <refpurpose> + 新規cdataノードを作成する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>DomDocument->create_cdata_section</methodname> + <methodparam><type>string</type><parameter>content</parameter></methodparam> + </methodsynopsis> + <para> + This function returns a new instance of class + <classname>DomCData</classname>. The content of the cdata is the + value of the passed parameter. This node will not show up in the + document unless it is inserted with e.g. + <function>DomNode_append_child</function>. + </para> + <para> + The return value is false if an error occured. + </para> + <para> + See also <function>DomNode_append_child</function>, + <function>DomDocument_create_element</function>, + <function>DomDocument_create_text</function>, + <function>DomDocument_create_attribute</function>, + <function>DomDocument_create_processing_instruction</function>, + <function>DomDocument_create_entity_reference</function>, + <function>DomNode_insert_before</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-create-processing-instruction"> + <refnamediv> + <refname>DomDocument->create_processing_instruction</refname> + <refpurpose> + 新規PIノードを作成する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>DomDocument->create_processing_instruction</methodname> + <methodparam><type>string</type><parameter>content</parameter></methodparam> + </methodsynopsis> + <para> + This function returns a new instance of class + <classname>DomCData</classname>. The content of the pi is the + value of the passed parameter. This node will not show up in the + document unless it is inserted with e.g. + <function>DomNode_append_child</function>. + </para> + <para> + The return value is false if an error occured. + </para> + <para> + See also <function>DomNode_append_child</function>, + <function>DomDocument_create_element</function>, + <function>DomDocument_create_text</function>, + <function>DomDocument_create_cdata_section</function>, + <function>DomDocument_create_attribute</function>, + <function>DomDocument_create_entity_reference</function>, + <function>DomNode_insert_before</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-create-attribute"> + <refnamediv> + <refname>DomDocument->create_attribute</refname> + <refpurpose> + 新規属性を作成する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomDocument->create_attribute</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + <methodparam><type>string</type><parameter>value</parameter></methodparam> + </methodsynopsis> + <para> + This function returns a new instance of class + <classname>DomAttribute</classname>. The name of the attribute is the + value of the first parameter. The value of the attribute is the value of + the second parameter. This node will not show up in the + document unless it is inserted with e.g. + <function>DomNode_append_child</function>. + </para> + <para> + The return value is false if an error occured. + </para> + <para> + See also <function>DomNode_append_child</function>, + <function>DomDocument_create_element</function>, + <function>DomDocument_create_text</function>, + <function>DomDocument_create_cdata_section</function>, + <function>DomDocument_create_processing_instruction</function>, + <function>DomDocument_create_entity_reference</function>, + <function>DomNode_insert_before</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-create-entity-reference"> + <refnamediv> + <refname>DomDocument->create_entity_reference</refname> + <refpurpose> + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomDocument->create_entity_reference</methodname> + <methodparam><type>string</type><parameter>content</parameter></methodparam> + </methodsynopsis> + <para> + This function returns a new instance of class + <classname>DomEntityReference</classname>. The content of the entity + reference is the + value of the passed parameter. This node will not show up in the + document unless it is inserted with e.g. + <function>DomNode_append_child</function>. + </para> + <para> + The return value is false if an error occured. + </para> + <para> + See also <function>DomNode_append_child</function>, + <function>DomDocument_create_element</function>, + <function>DomDocument_create_text</function>, + <function>DomDocument_create_cdata_section</function>, + <function>DomDocument_create_processing_instruction</function>, + <function>DomDocument_create_attribute</function>, + <function>DomNode_insert_before</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-get-elements-by-tagname"> + <refnamediv> + <refname>DomDocument->get_elements_by_tagname</refname> + <refpurpose> + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>array</type><methodname>DomDocument->get_elements_by_tagname</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + </para> + <para> + <function>DomDocument_add_root</function>も参照下さい。 + </para> + </refsect1> + </refentry> - <!-- class Dtd - --> + <refentry id="function.DomDocument-get-element-by-id"> + <refnamediv> + <refname>DomDocument->get_element_by_id</refname> + <refpurpose> + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomDocument->get_element_by_id</methodname> + <methodparam><type>string</type><parameter>id</parameter></methodparam> + </methodsynopsis> + <para> + </para> + <para> + <function>DomDocument_add_root</function>も参照下さい。 + </para> + </refsect1> + </refentry> + + <!-- End of class DomDocument --> + + <refentry id="function.DomDocument-add-root"> + <refnamediv> + <refname>DomDocument->add_root [deprecated]</refname> + <refpurpose> + ルートノードを追加する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>resource</type><methodname>DomDocument->add_root</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + &warn.experimental.func; + <para> + Adds a root element node to a dom document and returns the new node. + The element name is given in the passed parameter. + </para> + <para> + <example> + <title>Creating a simple HTML document header</title> + <programlisting role="php"> +<![CDATA[ +<?php +$doc = domxml_new_doc("1.0"); +$root = $doc->add_root("HTML"); +$head = $root->new_child("HEAD", ""); +$head->new_child("TITLE", "Hier der Titel"); +echo htmlentities($doc->dump_mem()); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-dump-mem"> + <refnamediv> + <refname>DomDocument->dump_mem</refname> + <refpurpose> + 内部XMLツリーを文字列にダンプする + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>DomDocument->dump_mem</methodname> + <methodparam choice="opt"><type>bool</type><parameter>format</parameter></methodparam> + </methodsynopsis> + &warn.experimental.func; + <para> + Creates an XML document from the dom representation. This function + usually is called after building a new dom document from scratch + as in the example below. The + <parameter>format</parameter> specifies whether the output should be + neatly formatted, or not. + </para> + <para> + <example> + <title>Creating a simple HTML document header</title> + <programlisting role="php"> +<![CDATA[ +<?php +$doc = domxml_new_doc("1.0"); +$root = $doc->create_element("HTML"); +$root = $doc->append_child($root); +$head = $doc->create_element("HEAD"); +$head = $root->append_child($head); +$title = $doc->create_element("TITLE"); +$title = $head->append_child($title); +$text = $doc->create_text_node("This is the title"); +$text = $title->append_child($text); +echo "<PRE>"; +echo htmlentities($doc->dump_mem(true)); +echo "</PRE>"; +?> +]]> + </programlisting> + </example> + </para> + <note> + <para> + The first parameter was added in PHP 4.3.0. + </para> + </note> + <para> + See also <function>DomDocument_dump_file</function>, + <function>DomDocument_html_dump_mem</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-dump-file"> + <refnamediv> + <refname>DomDocument->dump_file</refname> + <refpurpose> + 内部XMLツリーをファイルにダンプする + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>DomDocument->dump_file</methodname> + <methodparam><type>string</type><parameter>filename</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>compressionmode</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>format</parameter></methodparam> + </methodsynopsis> + <para> + Creates an XML document from the dom representation. This function + usually is called after building a new dom document from scratch + as in the example below. The + <parameter>format</parameter> specifies whether the output should be + neatly formatted, or not. The first parameter specifies the name of the + filename and the second parameter, whether it should be compressed or not. + </para> + <para> + <example> + <title>Creating a simple HTML document header</title> + <programlisting role="php"> +<![CDATA[ +<?php +$doc = domxml_new_doc("1.0"); +$root = $doc->create_element("HTML"); +$root = $doc->append_child($root); +$head = $doc->create_element("HEAD"); +$head = $root->append_child($head); +$title = $doc->create_element("TITLE"); +$title = $head->append_child($title); +$text = $doc->create_text_node("This is the title"); +$text = $title->append_child($text); +$doc->dump_file("/tmp/test.xml", false, true); +?> +]]> + </programlisting> + </example> + </para> + <para> + See also <function>DomDocument_dump_mem</function> + <function>DomDocument_html_dump_mem</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.DomDocument-html-dump-mem"> + <refnamediv> + <refname>DomDocument->html_dump_mem</refname> + <refpurpose> + HTMLとして文字列に内部XMLツリーをダンプする + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>DomDocument->html_dump_mem</methodname> + <void/> + </methodsynopsis> + <para> + Creates an HTML document from the dom representation. This function + usually is called after building a new dom document from scratch + as in the example below. + </para> + <para> + <example> + <title>Creating a simple HTML document header</title> + <programlisting role="php"> +<![CDATA[ +<?php +$doc = domxml_new_doc("1.0"); +$root = $doc->create_element("HTML"); +$root = $doc->append_child($root); +$head = $doc->create_element("HEAD"); +$head = $root->append_child($head); +$title = $doc->create_element("TITLE"); +$title = $head->append_child($title); +$text = $doc->create_text_node("This is the title"); +$text = $title->append_child($text); +echo "<PRE>"; +echo htmlentities($doc->html_dump_mem()); +echo "</PRE>"; +?> +]]> + </programlisting> + </example> + </para> + <para> + See also <function>DomDocument_dump_file</function>, + <function>DomDocument_html_dump_mem</function>. + </para> + </refsect1> + </refentry> + + <!-- Start of class DomElement --> + + <refentry id='function.DomElement-tagname'> + <refnamediv> + <refname>DomElement->tagname</refname> + <refpurpose> + 要素名を返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>DomElement->tagname</methodname> + <void/> + </methodsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.DomElement-get-attribute'> + <refnamediv> + <refname>DomElement->get_attribute</refname> + <refpurpose> + 属性の値を返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomElement->get_attribute</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + Returns the attribute with name <parameter>name</parameter> of the + current node. + </para> + <para> + See also <function>DomElement_set_attribute</function> + </para> + </refsect1> + </refentry> + + <refentry id='function.DomElement-set-attribute'> + <refnamediv> + <refname>DomElement->set_attribute</refname> + <refpurpose> + 新規属性を追加する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>bool</type><methodname>DomElement->set_attribute</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + <methodparam><type>string</type><parameter>value</parameter></methodparam> + </methodsynopsis> + <para> + Sets an attribute with name <parameter>name</parameter> ot the given + value. If the attribute does not exist, it will be created. + </para> + <para> + <example> + <title>属性を設定する</title> + <programlisting role="php"> +<![CDATA[ +<?php +$doc = domxml_new_doc("1.0"); +$node = $doc->create_element("para"); +$newnode = $doc->append_child($node); +$newnode->set_attribute("align", "left"); +?> +]]> + </programlisting> + </example> + </para> + <para> + <function>DomElement_get_attribute</function>も参照する。 + </para> + </refsect1> + </refentry> + + <refentry id='function.DomElement-get-attribute-node'> + <refnamediv> + <refname>DomElement->get_attribute_node</refname> + <refpurpose> + 属性の値を返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomElement->get_attribute_node</methodname> + <methodparam><type>object</type><parameter>attr</parameter></methodparam> + </methodsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.DomElement-set-attribute-node'> + <refnamediv> + <refname>DomElement->set_attribute_node</refname> + <refpurpose> + 新規属性を設定する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>bool</type><methodname>DomElement->set_attribute_node</methodname> + <methodparam><type>object</type><parameter>attr</parameter></methodparam> + </methodsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.DomElement-remove-attribute'> + <refnamediv> + <refname>DomElement->remove_attribute</refname> + <refpurpose> + 属性を削除する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>bool</type><methodname>DomElement->remove_attribute</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.DomElement-get-elements-by-tagname'> + <refnamediv> + <refname>DomElement->get_elements_by_tagname</refname> + <refpurpose> + タグ名により要素を取得する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>bool</type><methodname>DomElement->get_elements_by_tagname</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.DomElement-has-attribute'> + <refnamediv> + <refname>DomElement->has_attribute</refname> + <refpurpose> + 属性があるかどうかを調べる + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>bool</type><methodname>DomElement->has_attribute</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <!-- End of class DomElement --> + + <!-- Start of class DomNode --> + + <refentry id='function.DomNode-attributes'> + <refnamediv> + <refname>DomNode->attributes</refname> + <refpurpose> + 属性のリストを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>array</type><methodname>DomNode->attributes</methodname> + <void/> + </methodsynopsis> + <para> + This function only returns an array of attributes if the node is of + type XML_ELEMENT_NODE. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-node-name'> + <refnamediv> + <refname>DomNode->node_name</refname> + <refpurpose> + ノード名を返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>DomNode->node_name</methodname> + <void/> + </methodsynopsis> + <para> + Returns name of the node. The name has different meanings + for the different types of nodes as illustrated in the following table. + <table> + <title>Meaning of value</title> + <tgroup cols="2"> + <thead> + <row> + <entry>Type</entry> + <entry>Meaning</entry> + </row> + </thead> + <tbody> + <row> + <entry>DomAttribute</entry> + <entry>value of attribute</entry> + </row> + <row> + <entry>DomAttribute</entry> + <entry></entry> + </row> + <row> + <entry>DomCDataSection</entry> + <entry>#cdata-section</entry> + </row> + <row> + <entry>DomComment</entry> + <entry>#comment</entry> + </row> + <row> + <entry>DomDocument</entry> + <entry>#document</entry> + </row> + <row> + <entry>DomDocumentType</entry> + <entry>document type name</entry> + </row> + <row> + <entry>DomElement</entry> + <entry>tag name</entry> + </row> + <row> + <entry>DomEntity</entry> + <entry>name of entity</entry> + </row> + <row> + <entry>DomEntityReference</entry> + <entry>name of entity reference</entry> + </row> + <row> + <entry>DomNotation</entry> + <entry>notation name</entry> + </row> + <row> + <entry>DomProcessingInstruction</entry> + <entry>target</entry> + </row> + <row> + <entry>DomText</entry> + <entry>#text</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-node-value'> + <refnamediv> + <refname>DomNode->node_value</refname> + <refpurpose> + ノードの値を返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>DomNode->node_value</methodname> + <void/> + </methodsynopsis> + <para> + Returns value of the node. The value has different meanings + for the different types of nodes as illustrated in the following table. + <table> + <title>Meaning of value</title> + <tgroup cols="2"> + <thead> + <row> + <entry>Type</entry> + <entry>Meaning</entry> + </row> + </thead> + <tbody> + <row> + <entry>DomAttribute</entry> + <entry>value of attribute</entry> + </row> + <row> + <entry>DomAttribute</entry> + <entry></entry> + </row> + <row> + <entry>DomCDataSection</entry> + <entry>content</entry> + </row> + <row> + <entry>DomComment</entry> + <entry>content of comment</entry> + </row> + <row> + <entry>DomDocument</entry> + <entry>null</entry> + </row> + <row> + <entry>DomDocumentType</entry> + <entry>null</entry> + </row> + <row> + <entry>DomElement</entry> + <entry>null</entry> + </row> + <row> + <entry>DomEntity</entry> + <entry>null</entry> + </row> + <row> + <entry>DomEntityReference</entry> + <entry>null</entry> + </row> + <row> + <entry>DomNotation</entry> + <entry>null</entry> + </row> + <row> + <entry>DomProcessingInstruction</entry> + <entry>entire content without target</entry> + </row> + <row> + <entry>DomText</entry> + <entry>content of text</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-node-type'> + <refnamediv> + <refname>DomNode->node_type</refname> + <refpurpose> + ノードの型を返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>int</type><methodname>DomNode->node_type</methodname> + <void/> + </methodsynopsis> + <para> + Returns the type of the node. All possible types are listed in + the table in the introduction. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-last-child'> + <refnamediv> + <refname>DomNode->last_child</refname> + <refpurpose> + 最後の子ノードを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomNode->last_child</methodname> + <void/> + </methodsynopsis> + <para> + Returns the last child of the node. + </para> + <para> + See also <function>DomNode_first_child</function>, + <function>DomNode_next_sibling</function>, + <function>DomNode_previous_sibling</function>. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-first-child'> + <refnamediv> + <refname>DomNode->first_child</refname> + <refpurpose> + 最初の子ノードを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>bool</type><methodname>DomNode->first_child</methodname> + <void/> + </methodsynopsis> + <para> + Returns the first child of the node. + </para> + <para> + See also <function>DomNode_last_child</function>, + <function>DomNode_next_sibling</function>, + <function>DomNode_previous_sibling</function>. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-child-nodes'> + <refnamediv> + <refname>DomNode->child-nodes</refname> + <refpurpose> + 子ノードを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>array</type><methodname>DomNode->child_nodes</methodname> + <void/> + </methodsynopsis> + <para> + Returns all children of the node. + </para> + <para> + See also <function>DomNode_next_sibling</function>, + <function>DomNode_previous_sibling</function>. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-previous-sibling'> + <refnamediv> + <refname>DomNode->previous_sibling</refname> + <refpurpose> + 前の兄弟ノードを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomNode->previous_sibling</methodname> + <void/> + </methodsynopsis> + <para> + This function returns the previous sibling of the current node. + </para> + <para> + See also <function>DomNode_next_sibling</function>. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-next-sibling'> + <refnamediv> + <refname>DomNode->next_sibling</refname> + <refpurpose> + 次の兄弟ノードを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomNode->next_sibling</methodname> + <void/> + </methodsynopsis> + <para> + This function returns the next sibling of the current node. If there is + no next sibling it returns false. You can use this function to iterate + over all children of a node as shown in the example. + </para> + <para> + <example> + <title>Iterate over children</title> + <programlisting role="php"> +<![CDATA[ +<?php +include("example.inc"); + +if(!$dom = domxml_open_mem($xmlstr)) { + echo "Error while parsing the document\n"; + exit; +} + +$elements = $dom->get_elements_by_tagname("tbody"); +$element = $elements[0]; +$child = $element->first_child(); + +while($child) { + print_r($child); + $child = $child->next_sibling(); +} +?> +]]> + </programlisting> + </example> + </para> + <para> + See also <function>DomNode_previous_sibling</function>. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-parent-node'> + <refnamediv> + <refname>DomNode->parent_node</refname> + <refpurpose> + 親ノードを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomNode->parent_node</methodname> + <void/> + </methodsynopsis> + <para> + This function returns the parent node. + </para> + <para> + The following example will show two identical lists of children. + <example> + <title>Finding the document of a node</title> + <programlisting role="php"> +<![CDATA[ +<?php +$doc = domxml_new_doc("1.0"); +$node = $doc->create_element("para"); +$node = $doc->append_child($node); +$children = $doc->children(); +print_r($children); + +$doc2 = $node->parent_node(); +$children = $doc2->children(); +print_r($children); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-owner-document'> + <refnamediv> + <refname>DomNode->owner_document</refname> + <refpurpose> + このノードが属するドキュメントを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomNode->owner_document</methodname> + <void/> + </methodsynopsis> + <para> + This function returns the document the current node belongs to. + </para> + <para> + The following example will create two identical lists of children. + <example> + <title>Finding the document of a node</title> + <programlisting role="php"> +<![CDATA[ +<?php +$doc = domxml_new_doc("1.0"); +$node = $doc->create_element("para"); +$node = $doc->append_child($node); +$children = $doc->children(); +print_r($children); + +$doc2 = $node->owner_document(); +$children = $doc2->children(); +print_r($children); +?> +]]> + </programlisting> + </example> + </para> + <para> + See also <function>DomNode_insert_before</function>. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-insert-before'> + <refnamediv> + <refname>DomNode->insert_before</refname> + <refpurpose> + 新規ノードを子ノードとして挿入する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomNode->insert_before</methodname> + <methodparam><type>object</type><parameter>newnode</parameter></methodparam> + <methodparam><type>object</type><parameter>refnode</parameter></methodparam> + </methodsynopsis> + <para> + This function inserts the new node <parameter>newnode</parameter> right + before the node <parameter>refnode</parameter>. The return value is the + inserted node. If you plan to do further modifications on the appended + child you must use the returned node. + </para> + <para> + <function>DomNode_insert_before</function> is very similar to + <function>DomNode_append_child</function> as the following example shows + which does the same as the example at + <function>DomNode_append_child</function>. + </para> + <para> + <example> + <title>Adding a child</title> + <programlisting role="php"> +<![CDATA[ +include("example.inc"); + +if(!$dom = domxml_open_mem($xmlstr)) { + echo "Error while parsing the document\n"; + exit; +} + +$elements = $dom->get_elements_by_tagname("informaltable"); +print_r($elements); +$element = $elements[0]; + +$newnode = $element->insert_before($element, $element); +$children = $newnode->children(); +$attr = $children[1]->set_attribute("align", "left"); + +echo "<PRE>"; +$xmlfile = $dom->dump_mem(); +echo htmlentities($xmlfile); +echo "</PRE>"; +]]> + </programlisting> + </example> + </para> + <para> + See also <function>DomNode_append_child</function>. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-append-child'> + <refnamediv> + <refname>DomNode->append_child</refname> + <refpurpose> + 子ノードの最後に新規に子ノードを追加する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomNode->append_child</methodname> + <methodparam><type>object</type><parameter>newnode</parameter></methodparam> + </methodsynopsis> + <para> + This functions appends a child to an existing list of children or creates + a new list of children. The child can be created with e.g. + <function>DomDocument_create_element</function>, + <function>DomDocument_create_text</function> etc. or simply by using any + other node. + </para> + <para> + Before a new child is appended it is first duplicated. Therefore the new + child is a completely new copy which can be modified without changing the + node which was passed to this function. If the node passed has children + itself, they will be duplicated as well, which makes it quite easy to + duplicate large parts of a xml document. The return value is the + appended child. If you plan to do further modifications on the appended + child you must use the returned node. + </para> + <para> + The following example will add a new element node to a fresh document + and sets the attribute "align" to "left". + <example> + <title>Adding a child</title> + <programlisting role="php"> +<![CDATA[ +<?php +$doc = domxml_new_doc("1.0"); +$node = $doc->create_element("para"); +$newnode = $doc->append_child($node); +$newnode->set_attribute("align", "left"); +?> +]]> + </programlisting> + </example> + The above example could also be written as the following: + <example> + <title>Adding a child</title> + <programlisting role="php"> +<![CDATA[ +<?php +$doc = domxml_new_doc("1.0"); +$node = $doc->create_element("para"); +$node->set_attribute("align", "left"); +$newnode = $doc->append_child($node); +?> +]]> + </programlisting> + </example> + A more comples example is the one below. It first searches for a certain + element, duplicates it including its children and adds it as a sibling. + Finally a new attribute is added to one of the children of the new + sibling and the whole document is dumped. + <example> + <title>Adding a child</title> + <programlisting role="php"> +<![CDATA[ +<?php +include("example.inc"); + +if(!$dom = domxml_open_mem($xmlstr)) { + echo "Error while parsing the document\n"; + exit; +} + +$elements = $dom->get_elements_by_tagname("informaltable"); +print_r($elements); +$element = $elements[0]; + +$parent = $element->parent_node(); +$newnode = $parent->append_child($element); +$children = $newnode->children(); +$attr = $children[1]->set_attribute("align", "left"); + +echo "<PRE>"; +$xmlfile = $dom->dump_mem(); +echo htmlentities($xmlfile); +echo "</PRE>"; +?> +]]> + </programlisting> + </example> + The above example could also be done with + <function>DomNode_insert_before</function> instead of + <function>DomNode_append_child</function>. + </para> + <para> + See also <function>DomNode_insert_before</function>. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-remove-child'> + <refnamediv> + <refname>DomNode->remove_child</refname> + <refpurpose> + 子ノードのリストから子ノードを削除する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>object</type><methodname>DomNode->remove_child</methodname> + <methodparam><type>object</type><parameter>oldchild</parameter></methodparam> + </methodsynopsis> + <para> + This functions removes a child from a list of children. If child cannot + be removed or is not a child the function will return false. + If the child could be removed the functions returns the old child. + </para> + <para> + <example> + <title>Removing a child</title> + <programlisting role="php"> +<![CDATA[ +<?php +include("example.inc"); + +if(!$dom = domxml_open_mem($xmlstr)) { + echo "Error while parsing the document\n"; + exit; +} + +$elements = $dom->get_elements_by_tagname("tbody"); +$element = $elements[0]; +$children = $element->child_nodes(); +$child = $element->remove_child($children[0]); + +echo "<PRE>"; +$xmlfile = $dom->dump_mem(true); +echo htmlentities($xmlfile); +echo "</PRE>"; +?> +]]> + </programlisting> + </example> + </para> + <para> + See also <function>DomNode_append_child</function>. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-has-child-nodes'> + <refnamediv> + <refname>DomNode->has_child_nodes</refname> + <refpurpose> + ノードが子ノードを有しているかを調べる + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>bool</type><methodname>DomNode->has_child_nodes</methodname> + <void/> + </methodsynopsis> + <para> + This function checks if the node has children. + </para> + <para> + See also <function>DomNode_child_nodes</function>. + </para> + </refsect1> + </refentry> + + <refentry id='function.DomNode-has-attributes'> + <refnamediv> + <refname>DomNode->has_attributess</refname> + <refpurpose> + ノードが属性を有しているかを調べる + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>bool</type><methodname>DomNode->has_attributes</methodname> + <void/> + </methodsynopsis> + <para> + This function checks if the node has attributes. + </para> + <para> + See also <function>DomNode_has_child_nodes</function>. + </para> + </refsect1> + </refentry> - <refentry id="function.xmldoc"> + <refentry id='function.DomNode-prefix'> <refnamediv> - <refname>xmldoc</refname> - <refpurpose>XMLドキュメントのDOMオブジェクトを作成する</refpurpose> + <refname>DomNode->prefix</refname> + <refpurpose> + ノードの名前空間接頭辞を返す + </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>object</type><methodname>xmldoc</methodname> - <methodparam><type>string</type><parameter>str</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>string</type><methodname>DomNode->prefix</methodname> + <void/> + </methodsynopsis> <para> - この関数は、<parameter>str</parameter>のXMLドキュメントを処理し、 - クラス"Dom document"のオブジェクトを返します。このオブジェクトは - 上のリストに示したプロパティを有しています。 + Returns the name space prefix of the node. </para> - <simpara> - <function>xmldocfile</function>も参照下さい。 - </simpara> </refsect1> </refentry> - <refentry id="function.xmldocfile"> + <refentry id='function.DomNode-clone-node'> <refnamediv> - <refname>xmldocfile</refname> - <refpurpose>XMLファイルからDOMオブジェクトを作成する</refpurpose> + <refname>DomNode->clone_node</refname> + <refpurpose> + ノードの複製を作る + </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>object</type><methodname>xmldocfile</methodname> - <methodparam><type>string</type><parameter>filename</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>object</type><methodname>DomNode->clone_node</methodname> + <void/> + </methodsynopsis> <para> - この関数は、<parameter>filename</parameter>という名前のXMLドキュ - メントを解釈し、クラス"Dom document"のオブジェクトを返します。 - クラス"Dom document"のオブジェクトを返します。このオブジェクトは - 上のリストに示したプロパティを有しています。ファイルは読み込みの - み可能です。 + &warn.undocumented.func; </para> - <simpara> - <function>xmldoc</function>も参照下さい。 - </simpara> </refsect1> </refentry> - <refentry id="function.xmltree"> + <refentry id='function.DomNode-unlink-node'> <refnamediv> - <refname>xmltree</refname> + <refname>DomNode->unlink_node</refname> <refpurpose> - XMLドキュメントからPHPオブジェクトのツリーを作成する + ノードを削除する </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>object</type><methodname>xmltree</methodname> - <methodparam><type>string</type><parameter>str</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>object</type><methodname>DomNode->unlink_node</methodname> + <void/> + </methodsynopsis> <para> - この関数は、<parameter>str</parameter>のXMLドキュメントをパースし、 - パース済のドキュメントとしてPHPオブジェクトのツリーを返します。他 - の関数はこのツリーにはアクセスできないため、この関数は他の関数と - 異なっています。例えばノードを追加する時のように、このツリーを修 - 正することには、現在XMLファイルとしてツリーをダンプする手段がない - ため意味がありません。この関数は、ファイルを読み込んで定数を調べ - たい場合には有用です。 + &warn.undocumented.func; </para> </refsect1> </refentry> - <refentry id="function.domxml-root"> + <refentry id='function.DomNode-replace-node'> <refnamediv> - <refname>domxml_root</refname> + <refname>DomNode->replace_node</refname> <refpurpose> - ドキュメントのルートノードを返す + ノードを置換する </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>object</type><methodname>domxml_root</methodname> - <methodparam><type>object</type><parameter>doc</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>object</type><methodname>DomNode->replace_node</methodname> + <void/> + </methodsynopsis> <para> - <function>domxml_root</function> は引数としてクラスのオブジェクト - "Dom document"をとり、ルート要素ノードを返します。現在、コメント - のような他のノードは無視されます。 + &warn.undocumented.func; </para> - <para> - 以下の例は、名前 CHAPTER で要素を有する要素だけを返し、これを出力 - します。その他のルートノードであるコメントは返されません。 - <example> - <title>ルート要素を取得する</title> - <programlisting role="php"> -<![CDATA[ -<?php -$xmlstr = "<?xml version='1.0' standalone='yes'?> -<!DOCTYPE chapter SYSTEM '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd' -[ <!ENTITY sp \"spanish\"> -]> -<!-- lsfj --> -<chapter language='en'><title language='en'>Title</title> - <para language='ge'> - &amp;sp; - <!-- comment --> - <informaltable language='&amp;sp;'> - <tgroup cols='3'> - <tbody> - <row><entry>a1</entry><entry -morerows='1'>b1</entry><entry>c1</entry></row> -<row><entry>a2</entry><entry>c2</entry></row> - <row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row> - </tbody> - </tgroup> - </informaltable> - </para> -</chapter>"; + </refsect1> + </refentry> -if(!$dom = xmldoc($xmlstr)) { - echo "Error while parsing the document\n"; - exit; -} + <refentry id='function.DomNode-set-content'> + <refnamediv> + <refname>DomNode->set_content</refname> + <refpurpose> + ノードのコンテンツを設定する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>bool</type><methodname>DomNode->set_content</methodname> + <void/> + </methodsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> -$root = $dom->root(); -/* or $root = domxml_root($dom); */ -print_r($root); -?> -]]> - </programlisting> - </example> + <refentry id='function.DomNode-get-content'> + <refnamediv> + <refname>DomNode->get_content</refname> + <refpurpose> + ノードのコンテンツを取得する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>DomNode->get_content</methodname> + <void/> + </methodsynopsis> + <para> + &warn.undocumented.func; </para> </refsect1> </refentry> - <refentry id="function.domxml-add-root"> + <refentry id='function.DomNode-dump-node'> <refnamediv> - <refname>domxml_add_root</refname> + <refname>DomNode->dump_node</refname> <refpurpose> - ドキュメントにルートノードを追加する + ノードを1つダンプする </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>resource</type><methodname>domxml_add_root</methodname> - <methodparam><type>resource</type><parameter>doc</parameter></methodparam> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>string</type><methodname>DomNode->dump_node</methodname> + <void/> + </methodsynopsis> <para> - DOMドキュメントにルート要素ノードを追加し、新規ノードを返します。 - 要素名は、2番目の引数として指定します。 + &warn.undocumented.func; </para> <para> - <example> - <title>簡単なHTMLドキュメントヘッダを作成する</title> - <programlisting role="php"> -<![CDATA[ -<?php -$doc = new_xmldoc("1.0"); -$root = $doc->add_root("HTML"); -$head = $root->new_child("HEAD", ""); -$head->new_child("TITLE", "Hier der Titel"); -echo $doc->dumpmem(); -?> -]]> - </programlisting> - </example> + See also <function>DomDocument_dump_mem</function>. </para> </refsect1> </refentry> - <refentry id="function.domxml-dumpmem"> + <refentry id='function.DomNode-set-name'> <refnamediv> - <refname>domxml_dumpmem</refname> + <refname>DomNode->set_name</refname> <refpurpose> - ドキュメントを文字列にダンプする + ノードの名前を設定する </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>string</type><methodname>domxml_dumpmem</methodname> - <methodparam><type>resource</type><parameter>doc</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>bool</type><methodname>DomNode->set_name</methodname> + <void/> + </methodsynopsis> <para> - DOM表現からXMLドキュメントを作成します。この関数は、通常、 - <function>domxml_add_root</function> の例のように最初から新規に - DOMドキュメントを構築した後にコールされます。 + Sets name of node. </para> <para> - <function>domxml_add_root</function>も参照下さい。 + See also <function>DomNode_node_name</function>. </para> </refsect1> </refentry> - <refentry id="function.domxml-attributes"> + <refentry id='function.DomNode-is-blank-node'> <refnamediv> - <refname>domxml_attributes</refname> + <refname>DomNode->is_blank_node</refname> <refpurpose> - 指定したノードの属性のリストを返す + ノードが空かどうか調べる </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>array</type><methodname>domxml_attributes</methodname> - <methodparam><type>resource</type><parameter>node</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>bool</type><methodname>DomNode->is_blank_node</methodname> + <void/> + </methodsynopsis> <para> - "dom attribute"型のオブジェクトの配列としてノードの全ての属性を返 - します。 + &warn.undocumented.func; </para> </refsect1> </refentry> - <refentry id="function.domxml-get-attribute"> + <!-- End of class DomNode --> + + <!-- Start of class DomAttribute --> + + <refentry id='function.DomAttribute-name'> <refnamediv> - <refname>domxml_get_attribute</refname> + <refname>DomAttribute->name</refname> <refpurpose> - 指定したノードの属性の値を返す + 属性の名前を返す </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>object</type><methodname>domxml_get_attribute</methodname> - <methodparam><type>resource</type><parameter>node</parameter></methodparam> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>bool</type><methodname>DomAttribute->name</methodname> + <void/> + </methodsynopsis> <para> - この関数は、指定した名前<parameter>name</parameter>の値を返します。 + This function returns the name of the attribute. + </para> + <para> + See also <function>DomAttribute_value</function>. </para> - <simpara> - <function>domxml_set_attribute</function>も参照下さい。 - </simpara> </refsect1> </refentry> - <refentry id="function.domxml-set-attribute"> + <refentry id='function.DomAttribute-value'> <refnamediv> - <refname>domxml_set_attribute</refname> + <refname>DomAttribute->value</refname> <refpurpose> - 指定した属性の値を設定する + 属性の値を返す </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>object</type><methodname>domxml_set_attribute</methodname> - <methodparam><type>resource</type><parameter>node</parameter></methodparam> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - <methodparam><type>string</type><parameter>value</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>bool</type><methodname>DomAttribute->value</methodname> + <void/> + </methodsynopsis> <para> - 指定したノードの名前 <parameter>name</parameter> を有する属性に値 - を設定します。 + This function returns the value of the attribute. </para> <para> - <function>domxml_add_root</function> を例にとると、この例ではノー - ドのクラスの関数 <function>set_attribute</function> を単にコール - することにより、HEAD要素に属性を追加しています。 - <example> - <title>要素に属性を追加する</title> - <programlisting role="php"> -<![CDATA[ -<?php -$doc = new_xmldoc("1.0"); -$root = $doc->add_root("HTML"); -$head = $root->new_child("HEAD", ""); -$head->new_child("TITLE", "Hier der Titel"); -$head->set_attribute("Language", "ge"); -echo $doc->dumpmem(); -?> -]]> - </programlisting> - </example> + See also <function>DomAttribute_name</function>. </para> </refsect1> </refentry> - <refentry id="function.domxml-children"> + <refentry id='function.DomAttribute-specified'> <refnamediv> - <refname>domxml_children</refname> + <refname>DomAttribute->specified</refname> <refpurpose> - 子ノードのリストを返す + 属性が指定されているかどうか調べる </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>array</type><methodname>domxml_children</methodname> - <methodparam><type>object</type><parameter>doc|node</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>bool</type><methodname>DomAttribute->specified</methodname> + <void/> + </methodsynopsis> <para> - ノードの配列としてノードの全ての子ノードを返します。 - </para> - <para> - 以下の例では、変数 <varname>children</varname> には XML_ELEMENT - 型のノードの一つを有する配列が含まれます。このノードはTITLE要素で - す。 - <example> - <title>要素に属性を追加する</title> - <programlisting role="php"> -<![CDATA[ -<?php -$doc = new_xmldoc("1.0"); -$root = $doc->add_root("HTML"); -$head = $root->new_child("HEAD", ""); -$head->new_child("TITLE", "Hier der Titel"); -$head->set_attribute("Language", "ge"); -$children = $head->children(); -?> -]]> - </programlisting> - </example> + Check DOM standard for a detailed explanation. </para> </refsect1> </refentry> - <refentry id="function.domxml-new-child"> + <!-- End of class DomAttribute --> + + <!-- Start of class DomDocumentType --> + + <refentry id='function.DomDocumentType-name'> <refnamediv> - <refname>domxml_new_child</refname> + <refname>DomDocumentType->name</refname> <refpurpose> - 親ノードに子ノードを追加する + ドキュメントの型名を返す </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>resource</type><methodname>domxml_new_child</methodname> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - <methodparam><type>string</type><parameter>content</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>string</type><methodname>DomDocumentType->name</methodname> + <void/> + </methodsynopsis> <para> - ノードに新規に子ノードを追加し、返します。 + This function returns the name of the document type. </para> </refsect1> </refentry> - <refentry id="function.domxml-new-xmldoc"> + <refentry id='function.DomDocumentType-entities'> <refnamediv> - <refname>domxml_new_xmldoc</refname> + <refname>DomDocumentType->entities</refname> <refpurpose> - 新規に空のドキュメントを作成する + エントリのリスト返す </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>object</type><methodname>domxml_new_xmldoc</methodname> - <methodparam><type>string</type><parameter>version</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>array</type><methodname>DomDocumentType->entities</methodname> + <void/> + </methodsynopsis> <para> - 最初から新規DOMドキュメントを作成し、返します。 + &warn.undocumented.func; </para> + </refsect1> + </refentry> + + <refentry id='function.DomDocumentType-notations'> + <refnamediv> + <refname>DomDocumentType->notations</refname> + <refpurpose> + ノーテーションのリストを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>array</type><methodname>DomDocumentType->notations</methodname> + <void/> + </methodsynopsis> <para> - <function>domxml_add_root</function>も参照下さい。 + &warn.undocumented.func; </para> </refsect1> </refentry> - <refentry id="function.xpath_new_context"> + <refentry id='function.DomDocumentType-public-id'> <refnamediv> - <refname>xpath_new_context</refname> + <refname>DomDocumentType->public_id</refname> <refpurpose> - xpath コンテキストを新規に作成する + document typeのpublic IDを返す </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>object</type><methodname>xpath_new_context</methodname> - <methodparam><type>object</type><parameter>dom document</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>string</type><methodname>DomDocumentType->public_id</methodname> + <void/> + </methodsynopsis> <para> + This function returns the public id of the document type. </para> <para> - See also <function></function> + The following example echos nothing. + <example> + <title>Retrieving the public id</title> + <programlisting role="php"> +<![CDATA[ +<?php +include("example.inc"); + +if(!$dom = domxml_open_mem($xmlstr)) { + echo "Error while parsing the document\n"; + exit; +} + +$doctype = $dom->doctype(); +echo $doctype->public_id(); +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> - <refentry id="function.xpath_eval"> + <refentry id='function.DomDocumentType-system-id'> <refnamediv> - <refname>xpath_eval</refname> + <refname>DomDocumentType->system_id</refname> <refpurpose> - xpath 式を評価する + document typeのsystem IDを返す </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>array</type><methodname>xpath_eval</methodname> - <methodparam><type>object</type><parameter>xpath context</parameter></methodparam> - </methodsynopsis> - &warn.experimental.func; + <methodsynopsis> + <type>string</type><methodname>DomDocumentType->system_id</methodname> + <void/> + </methodsynopsis> <para> + Returns the system id of the document type. </para> <para> - See also <function></function> + The following example echos + '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd'. + <example> + <title>システムIDを取得する</title> + <programlisting role="php"> +<![CDATA[ +<?php +include("example.inc"); + +if(!$dom = domxml_open_mem($xmlstr)) { + echo "Error while parsing the document\n"; + exit; +} + +$doctype = $dom->doctype(); +echo $doctype->system_id(); +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> - <refentry id='function.domxml-node'> + <refentry id='function.DomDocumentType-internal-subset'> <refnamediv> - <refname>domxml_node</refname> - <refpurpose>ノードを作成する</refpurpose> + <refname>DomDocumentType->internal_subset</refname> + <refpurpose> + 内部サブセットを返す + </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>object</type><methodname>domxml_node</methodname> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>bool</type><methodname>DomDocumentType->internal_subset</methodname> + <void/> + </methodsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> - <refentry id='function.domxml-node-set-content'> + <!-- End of class DomDocumentType --> + + <!-- Start of class DomProcessingInstruction --> + + <refentry id='function.DomProcessingInstruction-target'> <refnamediv> - <refname>domxml_node_set_content</refname> - <refpurpose>ノードの内容を設定する</refpurpose> + <refname>DomProcessingInstruction->target</refname> + <refpurpose> + PIノードのターゲットを返す + </refpurpose> </refnamediv> <refsect1> <title>説明</title> - <methodsynopsis> - <type>bool</type><methodname>domxml_node_set_content</methodname> - <methodparam><type>string</type><parameter>content</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>string</type><methodname>DomProcessingInstruction->target</methodname> + <void/> + </methodsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.DomProcessingInstruction-data'> + <refnamediv> + <refname>DomProcessingInstruction->data</refname> + <refpurpose> + PIノードのデータを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <methodsynopsis> + <type>string</type><methodname>DomProcessingInstruction->data</methodname> + <void/> + </methodsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> - <refentry id='function.domxml-node-unlink-node'> + <!-- End of class DomProcessingInstruction --> + + <!-- Start of class XPathContext --> + <!-- End of class XPathContext --> + + <refentry id="function.xpath-new-context"> <refnamediv> - <refname>domxml_node_unlink_node</refname> - <refpurpose>ノードを削除する</refpurpose> + <refname>xpath_new_context</refname> + <refpurpose> + 新規xpathコンテキストを作成する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <methodsynopsis> - <type>object</type><methodname>domxml_node_unlink_node</methodname> - <void/> + <type>object</type><methodname>xpath_new_context</methodname> + <methodparam><type>object</type><parameter>dom document</parameter></methodparam> </methodsynopsis> + &warn.experimental.func; <para> - &warn.undocumented.func; + </para> + <para> + <function>xpath_eval</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.xpath-eval-expression"> + <refentry id="function.xpath-eval"> <refnamediv> - <refname>xpath_eval_expression</refname> + <refname>xpath_eval</refname> <refpurpose> - 指定文字列のXPathロケーションパスを評価する + 指定した文字列のXPathロケーションを評価する </refpurpose> </refnamediv> <refsect1> <title>説明</title> <methodsynopsis> <type>array</type><methodname>xpath_eval</methodname> - <methodparam><type>object</type><parameter>xpath_context</parameter></methodparam> + <methodparam><type>object</type><parameter>xpath context</parameter></methodparam> </methodsynopsis> - &warn.experimental.func; + &warn.experimental.func; <para> </para> <para> - See also <function></function> + <function>xpath_new_context</function>も参照下さい。 </para> </refsect1> </refentry> - <refentry id='function.domxml-version'> + <refentry id="function.xpath-eval-expression"> <refnamediv> - <refname>domxml_version</refname> + <refname>xpath_eval_expression</refname> <refpurpose> - XMLライブラリバージョンを取得する + 指定した文字列のXPathロケーション式を評価する </refpurpose> </refnamediv> <refsect1> <title>説明</title> <methodsynopsis> - <type>string</type><methodname>domxml_version</methodname> - <void/> + <type>array</type><methodname>xpath_eval_expression</methodname> + <methodparam><type>object</type><parameter>xpath_context</parameter></methodparam> </methodsynopsis> + &warn.experimental.func; <para> - この関数は、現在使用されるXMLライブラリのバージョンを返します。 + </para> + <para> + <function>xpath_eval</function>も参照下さい </para> </refsect1> </refentry> @@ -924,7 +2913,7 @@ <refnamediv> <refname>xptr_new_context</refname> <refpurpose> - Create new XPath Context + 新規XPathコンテキストを作成する </refpurpose> </refnamediv> <refsect1>
« previous php.doc (#969344380) next »