steinm Tue Jan 30 22:14:12 2001 EDT Modified files: /phpdoc/en/functions domxml.xml Log: - starting to document domxml functions
Index: phpdoc/en/functions/domxml.xml diff -u phpdoc/en/functions/domxml.xml:1.5 phpdoc/en/functions/domxml.xml:1.6 --- phpdoc/en/functions/domxml.xml:1.5 Fri Sep 15 09:09:43 2000 +++ phpdoc/en/functions/domxml.xml Tue Jan 30 22:14:12 2001 @@ -4,10 +4,26 @@ <partintro> <simpara> + This documentation ist not finished yet. Don't start to translate it + or use it as a programming reference ([EMAIL PROTECTED]). + </simpara> + <simpara> These functions are only available if PHP was configured with <option role="configure">--with-dom=[DIR]</option>, using the - GNOME xml library. You will need at least libxml-2.0.0 (the beta - version will not work). These functions have been added in PHP 4. + GNOME xml library. You will need at least libxml-2.2.7 + These functions have been added in PHP 4. + </simpara> + <simpara> + The extension allows to operate on an XML document with the DOM api. + It also provides a function <function>xmltree</function> to turn the + complete XML document into a tree of php objects. Currently this + tree is read only, which doesn't mean you cannot modify it, but it + would make any sense since <function>dumpmem</function> cannot be + applied to it. Therefore, if you want to read an XML file and write + a modified version use the <function>add_node</function>, + <function>set_attribute</function>, etc. and finaly + <function>dumpmem</function> functions. + </simpara> <simpara> This module defines the following constants: @@ -26,17 +42,17 @@ <row> <entry>XML_ELEMENT_NODE</entry> <entry>1</entry> - <entry></entry> + <entry>Node is an element</entry> </row> <row> <entry>XML_ATTRIBUTE_NODE</entry> <entry>2</entry> - <entry></entry> + <entry>Node is an attribute</entry> </row> <row> <entry>XML_TEXT_NODE</entry> <entry>3</entry> - <entry></entry> + <entry>Node is a piece of text</entry> </row> <row> <entry>XML_CDATA_SECTION_NODE</entry> @@ -51,22 +67,22 @@ <row> <entry>XML_ENTITY_NODE</entry> <entry>6</entry> - <entry></entry> + <entry>Node is an entity like &nbsp;</entry> </row> <row> <entry>XML_PI_NODE</entry> <entry>7</entry> - <entry></entry> + <entry>Node is a processing instruction</entry> </row> <row> <entry>XML_COMMENT_NODE</entry> <entry>8</entry> - <entry></entry> + <entry>Node is a comment</entry> </row> <row> <entry>XML_DOCUMENT_NODE</entry> <entry>9</entry> - <entry></entry> + <entry>Node is a document</entry> </row> <row> <entry>XML_DOCUMENT_TYPE_NODE</entry> @@ -97,10 +113,227 @@ </tgroup> </table> <simpara> - This module defines a number of classes. The DOM XML functions - return a parsed tree of the XML document with each node being an - object belonging to one of these classes. + This module defines a number of classes, which are listed — + including their + properties and method — in the following table. + + <table> + <title>DomDocument class (methods)</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Name</entry> + <entry>PHP name</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>root</entry> + <entry>domxml_root</entry> + <entry></entry> + </row> + <row> + <entry>children</entry> + <entry>domxml_children</entry> + <entry></entry> + </row> + <row> + <entry>add_root</entry> + <entry>domxml_add_root</entry> + <entry></entry> + </row> + <row> + <entry>dtd</entry> + <entry>domxml_intdtd</entry> + <entry></entry> + </row> + <row> + <entry>dumpmem</entry> + <entry>domxml</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> </simpara> + + <simpara> + <table> + <title>DomDocument class (attributes)</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Name</entry> + <entry>Type</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>doc</entry> + <entry>class DomDocument</entry> + <entry>The object itself</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></entry> + <entry>string</entry> + </row> + <row> + <entry>encoding</entry> + <entry>string</entry> + <entry></entry> + </row> + <row> + <entry>standalone</entry> + <entry>long</entry> + <entry></entry> + </row> + <row> + <entry>type</entry> + <entry>long</entry> + <entry></entry> + </row> + <row> + <entry>compression</entry> + <entry>long</entry> + <entry></entry> + </row> + <row> + <entry>charset</entry> + <entry>long</entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </simpara> + + <simpara> + <table> + <title>DomNode class (methods)</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Name</entry> + <entry>PHP name</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>lastchild</entry> + <entry>domxml_last_child</entry> + <entry></entry> + </row> + <row> + <entry>children</entry> + <entry>domxml_children</entry> + <entry></entry> + </row> + <row> + <entry>parent</entry> + <entry>domxml_parent</entry> + <entry></entry> + </row> + <row> + <entry>new_child</entry> + <entry>domxml_new_child</entry> + <entry></entry> + </row> + <row> + <entry>get_attribute</entry> + <entry>domxml_get_attribute</entry> + <entry></entry> + </row> + <row> + <entry>set_attribute</entry> + <entry>domxml_set_attribute</entry> + <entry></entry> + </row> + <row> + <entry>attributes</entry> + <entry>domxml_attributes</entry> + <entry></entry> + </row> + <row> + <entry>node</entry> + <entry>domxml_node</entry> + <entry></entry> + </row> + <row> + <entry>set_content</entry> + <entry>domxml_set_content</entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </simpara> + + <simpara> + <table> + <title>DomNode class (attributes)</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Name</entry> + <entry>Type</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>node</entry> + <entry>class DomNode</entry> + <entry>The object itself</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> + </simpara> + </partintro> <!-- class Dom document --> @@ -188,7 +421,11 @@ The function parses the XML document in <parameter>str</parameter> and returns an object of class "Dom document", having the properties "doc" (resource), "version" - (string) and "type" (long). + (string), "standalone" (long), "type" (long), + "compression" (long), + "charset" (long). If available the attributes "url" (string) and + "name" (string) are set as well. + </para> </refsect1> </refentry> @@ -210,7 +447,9 @@ The function parses the XML document in the file named <parameter>filename</parameter> and returns an object of class "Dom document", having the properties "doc" (resource), "version" - (string). + (string), "standalone" (long), "type" (long), "compression" (long), + "charset" (long). If available the attributes "url" (string) and "name" + (string) are set as well. <!-- conspiciously the file attribute is missing? --> @@ -241,22 +480,202 @@ </refsect1> </refentry> - </reference> + <refentry id="function.domxml_root"> + <refnamediv> + <refname>domxml_root</refname> + <refpurpose> + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_root</function></funcdef> + <paramdef>string <parameter>str</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + </para> + </refsect1> + </refentry> + + <refentry id="function.domxml_add_root"> + <refnamediv> + <refname>domxml_add_root</refname> + <refpurpose> + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_add_root</function></funcdef> + <paramdef>string <parameter>str</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + </para> + </refsect1> + </refentry> + + <refentry id="function.domxml_dumpmem"> + <refnamediv> + <refname>domxml_dumpmem</refname> + <refpurpose> + Dumps the internal XML tree back into a string + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>domxml_dumpmem</function></funcdef> + <paramdef>object <parameter>doc</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + </para> + </refsect1> + </refentry> + + <refentry id="function.domxml_attributes"> + <refnamediv> + <refname>domxml_attributes</refname> + <refpurpose> + Returns an array of attributes of a node + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_attributes</function></funcdef> + <paramdef>object <parameter>node</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + </para> + </refsect1> + </refentry> + + <refentry id="function.domxml_get_attribute"> + <refnamediv> + <refname>domxml_get_attribute</refname> + <refpurpose> + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_get_attribute</function></funcdef> + <paramdef>string <parameter>str</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + </para> + </refsect1> + </refentry> -<!-- - TODO + <refentry id="function.domxml_set_attribute"> + <refnamediv> + <refname>domxml_set_attribute</refname> + <refpurpose> + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_set_attribute</function></funcdef> + <paramdef>string <parameter>str</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + </para> + </refsect1> + </refentry> - domxml_root - domxml_add_root - domxml_dumpmem - domxml_attributes - domxml_getattr - domxml_setattr - domxml_children - domxml_new_child - domxml_node - domxml_new_xmldoc alias new_xmldoc ---> + <refentry id="function.domxml_children"> + <refnamediv> + <refname>domxml_children</refname> + <refpurpose> + Returns children of a node or document + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_children</function></funcdef> + <paramdef>object <parameter>doc|node</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + </para> + </refsect1> + </refentry> + + <refentry id="function.domxml_new_child"> + <refnamediv> + <refname>domxml_new_child</refname> + <refpurpose> + Adds new child node + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_new_child</function></funcdef> + <paramdef>object <parameter>node</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + </para> + </refsect1> + </refentry> + + <refentry id="function.domxml_new_xmldoc"> + <refnamediv> + <refname>domxml_new_xmldoc</refname> + <refpurpose> + Creates new empty XML document + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_new_xmldoc</function></funcdef> + <paramdef>object <parameter>node</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + </para> + </refsect1> + </refentry> + + <refentry id="function.domxml_node"> + <refnamediv> + <refname>domxml_node</refname> + <refpurpose> + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>object <function>domxml_node</function></funcdef> + <paramdef>object <parameter>node</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + </para> + </refsect1> + </refentry> + + </reference> <!-- Keep this comment at the end of the file Local variables: