mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 19:08:54 +00:00

Zeev blame Kristian and not me. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@20975 c90b9560-bf6c-de11-be94-00142212c4b1
269 lines
6.9 KiB
XML
269 lines
6.9 KiB
XML
<reference id="ref.domxml">
|
|
<title>DOM XML functions</title>
|
|
<titleabbrev>DOM XML</titleabbrev>
|
|
|
|
<partintro>
|
|
<simpara>
|
|
These functions are only available if PHP was configured with
|
|
<option role="configure">--with-dom=[DIR]</option>, using the
|
|
GNOME xml library. These functions have been added in PHP4.
|
|
</simpara>
|
|
<simpara>
|
|
This module defines the following constants:
|
|
</simpara>
|
|
<table>
|
|
<title>XML constants</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Constant</entry>
|
|
<entry>Value</entry>
|
|
<entry>Description</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></entry>
|
|
</row>
|
|
<row>
|
|
<entry>XML_PI_NODE</entry>
|
|
<entry>7</entry>
|
|
<entry></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>
|
|
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.
|
|
</simpara>
|
|
</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
|
|
-->
|
|
|
|
<!-- class Dtd
|
|
-->
|
|
|
|
<refentry id="function.xmldoc">
|
|
<refnamediv>
|
|
<refname>xmldoc</refname>
|
|
<refpurpose>Creates a DOM object of an XML document</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcdef>object <function>xmldoc</function></funcdef>
|
|
<paramdef>string <parameter>str</parameter></paramdef>
|
|
</funcsynopsis>
|
|
<para>
|
|
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).
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.xmldocfile">
|
|
<refnamediv>
|
|
<refname>xmldocfile</refname>
|
|
<refpurpose>Creates a DOM object from XML file</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcdef>object <function>xmldocfile</function></funcdef>
|
|
<paramdef>string <parameter>filename</parameter></paramdef>
|
|
</funcsynopsis>
|
|
<para>
|
|
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).
|
|
|
|
<!-- conspiciously the file attribute is missing? -->
|
|
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.xmltree">
|
|
<refnamediv>
|
|
<refname>xmltree</refname>
|
|
<refpurpose>
|
|
Creates a tree of php objects from XML document
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcdef>object <function>xmltree</function></funcdef>
|
|
<paramdef>string <parameter>str</parameter></paramdef>
|
|
</funcsynopsis>
|
|
<para>
|
|
The function parses the XML document in
|
|
<parameter>str</parameter> and returns a tree PHP objects as the
|
|
parsed document.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
</reference>
|
|
|
|
<!--
|
|
TODO
|
|
|
|
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
|
|
-->
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
-->
|