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

was doc typo. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@91826 c90b9560-bf6c-de11-be94-00142212c4b1
3079 lines
86 KiB
XML
3079 lines
86 KiB
XML
<!-- D O N O T E D I T T H I S F I L E ! ! !
|
|
|
|
it is still here for historical reasons only
|
|
(as translators may need to check old revision diffs)
|
|
|
|
if you want to change things documented in this file
|
|
you should now edit the files found under en/reference
|
|
instead -->
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.44 $ -->
|
|
<reference id="ref.domxml">
|
|
<title>DOM XML functions</title>
|
|
<titleabbrev>DOM XML</titleabbrev>
|
|
|
|
<partintro>
|
|
<sect1 id="domxml-intro">
|
|
<title>Introduction</title>
|
|
&warn.experimental;
|
|
<para>
|
|
The domxml extension has been overhauled in PHP Version 4.3.0 in favour
|
|
of a better compliance of the DOM standard. The extension still contains
|
|
many old functions, but they should not be used anymore. Especially those
|
|
non object oriented functions should be avoided.
|
|
</para>
|
|
<para>
|
|
The extension allows you to operate on an XML document with the DOM API.
|
|
It also provides a function <function>domxml_xmltree</function> to turn the
|
|
complete XML document into a tree of PHP objects. Currently this
|
|
tree should be considered read-only - you can modify it but this
|
|
would not make any sense since <function>DomDocument_dump_mem</function>
|
|
cannot be
|
|
applied to it. Therefore, if you want to read an XML file and write
|
|
a modified version use the <function>DomDocument_create_element</function>,
|
|
<function>DomDocument_create_text</function>,
|
|
<function>set_attribute</function>, etc. and finally
|
|
<function>DomDocument_dump_mem</function> functions.
|
|
</para>
|
|
</sect1>
|
|
|
|
<sect1 id="domxml-requirements">
|
|
<title>Requirements</title>
|
|
<para>
|
|
This extension is only available if PHP was configured with
|
|
<option role="configure">--with-dom=[DIR]</option>, using the
|
|
<ulink url="&url.domxml;">GNOME xml library</ulink>.
|
|
You will need at least libxml-2.4.14.
|
|
</para>
|
|
</sect1>
|
|
|
|
<sect1 id="domxml-deprecated">
|
|
<title>Deprecated functions</title>
|
|
<para>
|
|
There a quite some functions which do not fit into the DOM standard and
|
|
should not be used anymore as listed a in the following table.
|
|
The function <function>DomNode_append_child</function> has changed its
|
|
behaviour. In now actually adds a child and not a sibling. If this
|
|
breaks your application use the non DOM function
|
|
<function>DomNode_append_sibling</function>.
|
|
</para>
|
|
<para>
|
|
<table>
|
|
<title>Deprecated functions and its replacements</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Old function</entry>
|
|
<entry>New function</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> followed by
|
|
<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>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_set_content</entry>
|
|
<entry>Create a new node with e.g.
|
|
<function>DomDocument_create_text_node</function> und add it with
|
|
<function>DomNode_append_child</function>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>DomNode_get_content</entry>
|
|
<entry>Content is just a text node and can be accessed with
|
|
<function>DomNode_child_nodes</function>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>DomNode_set_content</entry>
|
|
<entry>Content is just a text node and can be added with
|
|
<function>DomNode_append_child</function>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</sect1>
|
|
|
|
<sect1 id="domxml-constants">
|
|
<title>Constants</title>
|
|
<para>
|
|
This module defines the following constants:
|
|
</para>
|
|
<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>Node is an element</entry>
|
|
</row>
|
|
<row>
|
|
<entry>XML_ATTRIBUTE_NODE</entry>
|
|
<entry>2</entry>
|
|
<entry>Node is an attribute</entry>
|
|
</row>
|
|
<row>
|
|
<entry>XML_TEXT_NODE</entry>
|
|
<entry>3</entry>
|
|
<entry>Node is a piece of text</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>Node is an entity like &nbsp;</entry>
|
|
</row>
|
|
<row>
|
|
<entry>XML_PI_NODE</entry>
|
|
<entry>7</entry>
|
|
<entry>Node is a processing instruction</entry>
|
|
</row>
|
|
<row>
|
|
<entry>XML_COMMENT_NODE</entry>
|
|
<entry>8</entry>
|
|
<entry>Node is a comment</entry>
|
|
</row>
|
|
<row>
|
|
<entry>XML_DOCUMENT_NODE</entry>
|
|
<entry>9</entry>
|
|
<entry>Node is a document</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>Classes</title>
|
|
<para>
|
|
The API of the module follows the DOM Level 2 standard as close
|
|
as possible. Consequently the API is fully object oriented.
|
|
It is a good idea to have the DOM standard available when
|
|
using this module.
|
|
Though the API is object oriented there are many functions which can
|
|
be called in a non-object oriented way by passing the object to operate
|
|
on as the first argument. These function are mainly to retain compatibilty
|
|
to older versions of the extension but are not encouraged to use anymore
|
|
in new developments.
|
|
</para>
|
|
<para>
|
|
This API differs from the official DOM API in two points. First, all
|
|
class attributes are implemented as functions with the same name and
|
|
secondly the function names follow the PHP naming convention. This means
|
|
that a DOM function lastChild() will be written as last_child().
|
|
</para>
|
|
<para>
|
|
This module defines a number of classes, which are listed —
|
|
including their
|
|
method — in the following tables. Classes with an equivalent in the
|
|
DOM Standard are named DOMxxx.
|
|
</para>
|
|
|
|
<para>
|
|
<table>
|
|
<title>List of classes</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Class name</entry>
|
|
<entry>Parent classes</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>Currently still called DomParser</entry>
|
|
</row>
|
|
<row>
|
|
<entry>XPathContext</entry>
|
|
<entry></entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
|
|
<para>
|
|
<table>
|
|
<title>DomDocument class (DomDocument : DomNode)</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Method name</entry>
|
|
<entry>Function name</entry>
|
|
<entry>Remark</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>not DOM standard</entry>
|
|
</row>
|
|
<row>
|
|
<entry>dump_file</entry>
|
|
<entry><function>DomDocument_dump_file</function></entry>
|
|
<entry>not DOM standard</entry>
|
|
</row>
|
|
<row>
|
|
<entry>html_dump_mem</entry>
|
|
<entry><function>DomDocument_html_dump_mem</function></entry>
|
|
<entry>not DOM standard</entry>
|
|
</row>
|
|
<row>
|
|
<entry>xpath_init</entry>
|
|
<entry>xpath_init</entry>
|
|
<entry>not DOM standard</entry>
|
|
</row>
|
|
<row>
|
|
<entry>xpath_new_context</entry>
|
|
<entry>xpath_new_context</entry>
|
|
<entry>not DOM standard</entry>
|
|
</row>
|
|
<row>
|
|
<entry>xptr_new_context</entry>
|
|
<entry>xptr_new_context</entry>
|
|
<entry>not DOM standard</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
|
|
<para>
|
|
<table>
|
|
<title>DomElement class (DomElement : DomNode)</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Method name</entry>
|
|
<entry>Function name</entry>
|
|
<entry>Remark</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 class</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Method name</entry>
|
|
<entry>Remark</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_append_sibling</function></entry>
|
|
<entry>Not in DOM standard. This function emulates the former
|
|
behaviour of <function>DomNode_append_child</function>.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><function>DomNode_remove_child</function></entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><function>DomNode_replace_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>Not in DOM standard</entry>
|
|
</row>
|
|
<row>
|
|
<entry><function>DomNode_replace_node</function></entry>
|
|
<entry>Not in DOM standard</entry>
|
|
</row>
|
|
<row>
|
|
<entry><function>DomNode_set_content</function></entry>
|
|
<entry>Not in DOM standard, deprecated</entry>
|
|
</row>
|
|
<row>
|
|
<entry><function>DomNode_get_content</function></entry>
|
|
<entry>Not in DOM standard, deprecated</entry>
|
|
</row>
|
|
<row>
|
|
<entry><function>DomNode_dump_node</function></entry>
|
|
<entry>Not in DOM standard</entry>
|
|
</row>
|
|
<row>
|
|
<entry><function>DomNode_is_blank_node</function></entry>
|
|
<entry>Not in DOM standard</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
|
|
<para>
|
|
<table>
|
|
<title>DomAttribute class (DomAttribute : DomNode)</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Method name</entry>
|
|
<entry></entry>
|
|
<entry>Remark</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 class (DomProcessingInstruction : DomNode)</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Method name</entry>
|
|
<entry>Function name</entry>
|
|
<entry>Remark</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 class</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Method name</entry>
|
|
<entry>Function name</entry>
|
|
<entry>Remark</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 class</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Method name</entry>
|
|
<entry>Function name</entry>
|
|
<entry>Remark</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 class (DomDocumentType : DomNode)</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Method name</entry>
|
|
<entry>Function name</entry>
|
|
<entry>Remark</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>
|
|
The classes DomDtd is derived from DomNode. DomComment is derived from
|
|
DomCData
|
|
</para>
|
|
</sect1>
|
|
|
|
<sect1 id="domxml-examples">
|
|
<title>Examples</title>
|
|
<para>
|
|
Many examples in this reference require a xml string. Instead of
|
|
repeating this string in any example it will be put into a file
|
|
and be included by each example. This include file is shown in the
|
|
following example section. You could also create an xml document
|
|
read it with <function>DomDocument_open_file</function>.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Include file example.inc with xml string</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'>
|
|
&sp;
|
|
<!-- comment -->
|
|
<informaltable ID='findme' language='&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>
|
|
|
|
<refentry id="function.domxml-open-mem">
|
|
<refnamediv>
|
|
<refname>domxml_open_mem</refname>
|
|
<refpurpose>Creates a DOM object of an XML document</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>domxml_open_mem</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
The function parses the XML document in
|
|
<parameter>str</parameter> and returns an object of class "Dom
|
|
document", having the properties as listed above. This function,
|
|
<function>domxml_open_file</function> or <function>domxml_new_doc</function>
|
|
must be called before any other function calls.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Opening a xml document in a string</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>
|
|
See also <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>Creates a DOM object from XML file</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>domxml_open_file</methodname>
|
|
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<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 as listed above.
|
|
The file is accessed read-only.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Opening a xml document from a file</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>
|
|
See also <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>
|
|
Creates new empty XML document
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>domxml_new_doc</methodname>
|
|
<methodparam><type>string</type><parameter>version</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<para>
|
|
Creates a new dom document from scratch and returns it.
|
|
</para>
|
|
<para>
|
|
See also <function>DomDocument_add_root</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.domxml-xmltree">
|
|
<refnamediv>
|
|
<refname>domxml_xmltree</refname>
|
|
<refpurpose>
|
|
Creates a tree of PHP objects from an XML document
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>domxml_xmltree</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<para>
|
|
The function parses the XML document in
|
|
<parameter>str</parameter> and returns a tree PHP objects as the
|
|
parsed document. This function is isolated from the other functions,
|
|
which means you cannot access the tree with any of the other functions.
|
|
Modifying it, for example by adding nodes, makes no sense since there
|
|
is currently no way to dump it as an XML file.
|
|
However this function may be valuable if you want to read a file and
|
|
investigate the content.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.domxml-version'>
|
|
<refnamediv>
|
|
<refname>domxml_version</refname>
|
|
<refpurpose>
|
|
Get XML library version
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>domxml_version</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function returns the version of the XML library version currently used.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Start of class DomDocument -->
|
|
|
|
<refentry id="function.DomDocument-doctype">
|
|
<refnamediv>
|
|
<refname>DomDocument->doctype</refname>
|
|
<refpurpose>
|
|
Returns the document type
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>DomDocument->doctype</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function returns an object of class
|
|
<classname>DomDocumentType</classname>. In versions of
|
|
PHP before 4.3 this has been the class <classname>Dtd</classname>,
|
|
but the DOM Standard does not know such a class.
|
|
</para>
|
|
<para>
|
|
See also the methods of class <classname>DomDocumentType</classname>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.DomDocument-document-element">
|
|
<refnamediv>
|
|
<refname>DomDocument->document_element</refname>
|
|
<refpurpose>
|
|
Returns root element node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Create new element node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Create new text node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Create new comment node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Create new cdata node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Creates new PI node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Create new attribute
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>Description</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>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>DomDocument->get_elements_by_tagname</methodname>
|
|
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
</para>
|
|
<para>
|
|
See also <function>DomDocument_add_root</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.DomDocument-get-element-by-id">
|
|
<refnamediv>
|
|
<refname>DomDocument->get_element_by_id</refname>
|
|
<refpurpose>
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>DomDocument->get_element_by_id</methodname>
|
|
<methodparam><type>string</type><parameter>id</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
</para>
|
|
<para>
|
|
See also <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>
|
|
Adds a root node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Dumps the internal XML tree back into a string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Dumps the internal XML tree back into a file
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Dumps the internal XML tree back into a string as HTML
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns name of element
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns value of attribute
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Adds new attribute
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>Setting an attribute</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>
|
|
See also <function>DomElement_get_attribute</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomElement-get-attribute-node'>
|
|
<refnamediv>
|
|
<refname>DomElement->get_attribute_node</refname>
|
|
<refpurpose>
|
|
Returns value of attribute
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Adds new attribute
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Adds new attribute
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Adds new attribute
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Adds new attribute
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns list of attributes
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns name of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns value of a node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns type of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns last child of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns first child of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns children of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns the previous sibling of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns the next sibling of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns the parent of the node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Returns the document this node belongs to
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Inserts new node as child
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Adds new child at the end of the children
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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-append-sibling'>
|
|
<refnamediv>
|
|
<refname>DomNode->append_sibling</refname>
|
|
<refpurpose>
|
|
Adds new sibling to a node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>DomNode->append_sibling</methodname>
|
|
<methodparam><type>object</type><parameter>newnode</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This functions appends a sibling to an existing node.
|
|
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 sibling is added 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
|
|
added sibling. If you plan to do further modifications on the added
|
|
sibling you must use the returned node.
|
|
</para>
|
|
<para>
|
|
This function has been added to provide the behaviour of
|
|
<function>DomNode_append_child</function> as it works till PHP 4.2.
|
|
<para>
|
|
See also <function>DomNode_append_before</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomNode-remove-child'>
|
|
<refnamediv>
|
|
<refname>DomNode->remove_child</refname>
|
|
<refpurpose>
|
|
Removes child from list of children
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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 the child cannot
|
|
be removed or is not a child the function will return false.
|
|
If the child could be removed the function 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-replace-child'>
|
|
<refnamediv>
|
|
<refname>DomNode->replace_child</refname>
|
|
<refpurpose>
|
|
Replaces child from list of children
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>DomNode->replace_child</methodname>
|
|
<methodparam><type>object</type><parameter>newchild</parameter></methodparam>
|
|
<methodparam><type>object</type><parameter>oldchild</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This functions replace a child from a list of children. If the child cannot
|
|
be replaced or the old child cannot be found the function will return
|
|
false.
|
|
If the child could be replaced the function 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>
|
|
Checks if node has children
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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>
|
|
Checks if node has attributes
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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.DomNode-prefix'>
|
|
<refnamediv>
|
|
<refname>DomNode->prefix</refname>
|
|
<refpurpose>
|
|
Returns name space prefix of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>DomNode->prefix</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns the name space prefix of the node.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomNode-clone-node'>
|
|
<refnamediv>
|
|
<refname>DomNode->clone_node</refname>
|
|
<refpurpose>
|
|
Clones a node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>DomNode->clone_node</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomNode-unlink-node'>
|
|
<refnamediv>
|
|
<refname>DomNode->unlink_node</refname>
|
|
<refpurpose>
|
|
Deletes node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>DomNode->unlink_node</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomNode-replace-node'>
|
|
<refnamediv>
|
|
<refname>DomNode->replace_node</refname>
|
|
<refpurpose>
|
|
Replaces node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>DomNode->replace_node</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomNode-set-content'>
|
|
<refnamediv>
|
|
<refname>DomNode->set_content</refname>
|
|
<refpurpose>
|
|
Sets content of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>DomNode->set_content</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomNode-get-content'>
|
|
<refnamediv>
|
|
<refname>DomNode->get_content</refname>
|
|
<refpurpose>
|
|
Gets content of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>DomNode->get_content</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomNode-dump-node'>
|
|
<refnamediv>
|
|
<refname>DomNode->dump_node</refname>
|
|
<refpurpose>
|
|
Dumps a single node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>DomNode->dump_node</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
<para>
|
|
See also <function>DomDocument_dump_mem</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomNode-set-name'>
|
|
<refnamediv>
|
|
<refname>DomNode->set_name</refname>
|
|
<refpurpose>
|
|
Sets name of node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>DomNode->set_name</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Sets name of node.
|
|
</para>
|
|
<para>
|
|
See also <function>DomNode_node_name</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomNode-is-blank-node'>
|
|
<refnamediv>
|
|
<refname>DomNode->is_blank_node</refname>
|
|
<refpurpose>
|
|
Checks if node is blank
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>DomNode->is_blank_node</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- End of class DomNode -->
|
|
|
|
<!-- Start of class DomAttribute -->
|
|
|
|
<refentry id='function.DomAttribute-name'>
|
|
<refnamediv>
|
|
<refname>DomAttribute->name</refname>
|
|
<refpurpose>
|
|
Returns name of attribute
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>DomAttribute->name</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function returns the name of the attribute.
|
|
</para>
|
|
<para>
|
|
See also <function>DomAttribute_value</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomAttribute-value'>
|
|
<refnamediv>
|
|
<refname>DomAttribute->value</refname>
|
|
<refpurpose>
|
|
Returns value of attribute
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>DomAttribute->value</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function returns the value of the attribute.
|
|
</para>
|
|
<para>
|
|
See also <function>DomAttribute_name</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomAttribute-specified'>
|
|
<refnamediv>
|
|
<refname>DomAttribute->specified</refname>
|
|
<refpurpose>
|
|
Checks if attribute is specified
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>DomAttribute->specified</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Check DOM standard for a detailed explanation.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- End of class DomAttribute -->
|
|
|
|
<!-- Start of class DomDocumentType -->
|
|
|
|
<refentry id='function.DomDocumentType-name'>
|
|
<refnamediv>
|
|
<refname>DomDocumentType->name</refname>
|
|
<refpurpose>
|
|
Returns name of document type
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<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.DomDocumentType-entities'>
|
|
<refnamediv>
|
|
<refname>DomDocumentType->entities</refname>
|
|
<refpurpose>
|
|
Returns list of entities
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>DomDocumentType->entities</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomDocumentType-notations'>
|
|
<refnamediv>
|
|
<refname>DomDocumentType->notations</refname>
|
|
<refpurpose>
|
|
Returns list of notations
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>DomDocumentType->notations</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.DomDocumentType-public-id'>
|
|
<refnamediv>
|
|
<refname>DomDocumentType->public_id</refname>
|
|
<refpurpose>
|
|
Returns public id of document type
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>DomDocumentType->public_id</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function returns the public id of the document type.
|
|
</para>
|
|
<para>
|
|
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.DomDocumentType-system-id'>
|
|
<refnamediv>
|
|
<refname>DomDocumentType->system_id</refname>
|
|
<refpurpose>
|
|
Returns system id of document type
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>DomDocumentType->system_id</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns the system id of the document type.
|
|
</para>
|
|
<para>
|
|
The following example echos
|
|
'/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd'.
|
|
<example>
|
|
<title>Retrieving the system 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.DomDocumentType-internal-subset'>
|
|
<refnamediv>
|
|
<refname>DomDocumentType->internal_subset</refname>
|
|
<refpurpose>
|
|
Returns internal subset
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>DomDocumentType->internal_subset</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- End of class DomDocumentType -->
|
|
|
|
<!-- Start of class DomProcessingInstruction -->
|
|
|
|
<refentry id='function.DomProcessingInstruction-target'>
|
|
<refnamediv>
|
|
<refname>DomProcessingInstruction->target</refname>
|
|
<refpurpose>
|
|
Returns target of pi node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<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>
|
|
Returns data of pi node
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>DomProcessingInstruction->data</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- End of class DomProcessingInstruction -->
|
|
|
|
<!-- Start of class XPathContext -->
|
|
<!-- End of class XPathContext -->
|
|
|
|
<refentry id="function.xpath-new-context">
|
|
<refnamediv>
|
|
<refname>xpath_new_context</refname>
|
|
<refpurpose>
|
|
Creates new xpath context
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>xpath_new_context</methodname>
|
|
<methodparam><type>object</type><parameter>dom document</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<para>
|
|
</para>
|
|
<para>
|
|
See also <function>xpath_eval</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.xpath-eval">
|
|
<refnamediv>
|
|
<refname>xpath_eval</refname>
|
|
<refpurpose>
|
|
Evaluates the XPath Location Path in the given string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>xpath_eval</methodname>
|
|
<methodparam><type>object</type><parameter>xpath context</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<para>
|
|
</para>
|
|
<para>
|
|
See also <function>xpath_new_context</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.xpath-eval-expression">
|
|
<refnamediv>
|
|
<refname>xpath_eval_expression</refname>
|
|
<refpurpose>
|
|
Evaluates the XPath Location Path in the given string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>xpath_eval_expression</methodname>
|
|
<methodparam><type>object</type><parameter>xpath_context</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<para>
|
|
</para>
|
|
<para>
|
|
See also <function>xpath_eval</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.xptr-new-context'>
|
|
<refnamediv>
|
|
<refname>xptr_new_context</refname>
|
|
<refpurpose>
|
|
Create new XPath Context
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>xptr_new_context</methodname>
|
|
<methodparam choice="opt"><type>object</type><parameter>doc_handle</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id='function.xptr-eval'>
|
|
<refnamediv>
|
|
<refname>xptr_eval</refname>
|
|
<refpurpose>
|
|
Evaluate the XPtr Location Path in the given string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>xptr_eval</methodname>
|
|
<methodparam choice="opt"><type>object</type><parameter>xpath_context</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>eval_str</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
&warn.undocumented.func;
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
</reference>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|
|
|