|
| XML_Tree_Node ($name, $content= '', $attributes=array(), $lineno=null, $use_cdata_section=null) |
|
& | addChild ($child, $content= '', $attributes=array(), $lineno=null, $use_cdata_section=null) |
|
& | cloneNode () |
|
& | insertChild ($path, $pos, &$child, $content= '', $attributes=array()) |
|
& | removeChild ($pos) |
|
| registerName ($name, $path) |
|
& | get ($use_cdata_section=false) |
|
| getAttribute ($name) |
|
| setAttribute ($name, $value= '') |
|
| unsetAttribute ($name) |
|
| setContent ($content, $use_cdata_section=null) |
|
& | getElement ($path) |
|
& | getNodeAt ($path) |
|
| encodeXmlEntities ($xml) |
|
| decodeXmlEntities ($xml) |
|
| dump () |
|
|
| $attributes |
|
| $children |
|
| $content |
|
| $name |
|
| $namespaces = array() |
|
| $error = null |
|
| $use_cdata_section = null |
|
Definition at line 32 of file Node.php.
& addChild |
( |
|
$child, |
|
|
|
$content = '' , |
|
|
|
$attributes = array() , |
|
|
|
$lineno = null , |
|
|
|
$use_cdata_section = null |
|
) |
| |
Append a child node to this node, after all other nodes
- Parameters
-
mixed | child Child to insert (XML_Tree or XML_Tree_Node), or name of child node |
string | content Content (text) for the new node (only if $child is the node name) |
array | attributes Attribute-hash for new node |
- Returns
- object reference to new child node public
Definition at line 138 of file Node.php.
Get a copy of this node by clone this node and all of its children, recursively.
- Returns
- object Reference to the cloned copy. public
Definition at line 170 of file Node.php.
decodeXmlEntities |
( |
|
$xml | ) |
|
Decode XML entities in a text string.
- Parameters
-
- Returns
- string Decoded text public
Definition at line 562 of file Node.php.
encodeXmlEntities |
( |
|
$xml | ) |
|
Escape XML entities.
- Parameters
-
string | xml Text string to escape. |
- Returns
- string xml public
Definition at line 520 of file Node.php.
& get |
( |
|
$use_cdata_section = false | ) |
|
Returns text representation of this node.
- Returns
- string text (xml) representation of this node. Each tag is indented according to its level. public
Definition at line 294 of file Node.php.
Get an attribute by its name.
- Parameters
-
string | $name | Name of attribute to retrieve |
- Returns
- string attribute, or null if attribute is unset. public
Definition at line 376 of file Node.php.
Gets an element by its 'path'.
- Parameters
-
array | path path to element: sequence of indexes to the children. E.g. array(1, 2, 3) means "third
child of second child of first child" of the node. |
- Returns
- object reference to element found, or PEAR_Error if node can't be found. public
Definition at line 444 of file Node.php.
Get a reference to a node by its 'path'.
- Parameters
-
mixed | path Path to node. Can be either a string (slash-separated children names) or an array (sequence of children names) both starting from this node. The first name in sequence is a child name, not the name of this node. |
- Returns
- object Reference to the XML_Tree_Node found, or PEAR_Error if the path does not match any node. Note that if more than one element matches then only the first matching node is returned. public
Definition at line 480 of file Node.php.
& insertChild |
( |
|
$path, |
|
|
|
$pos, |
|
|
& |
$child, |
|
|
|
$content = '' , |
|
|
|
$attributes = array() |
|
) |
| |
Inserts child ($child) to a specified child-position ($pos)
- Parameters
-
mixed | path Path to parent node to add child (see getNodeAt() for format). If null child is inserted in the current node. |
integer | pos Position where to insert the new child. 0 < means |$pos| elements before the end, e.g. -1 appends as last child. |
mixed | child Child to insert (XML_Tree or XML_Tree_Node), or name of child node |
string | content Content (text) for the new node (only if $child is the node name) |
array | attributes Attribute-hash for new node |
- Returns
- Reference to the newly inserted node, or PEAR_Error upon insertion error. public
Definition at line 209 of file Node.php.
registerName |
( |
|
$name, |
|
|
|
$path |
|
) |
| |
Register a namespace.
- Parameters
-
string | $name | namespace |
string | $path | path |
public
Definition at line 282 of file Node.php.
Removes child at a given position
- Parameters
-
integer | pos position of child to remove in children-list. 0 < means |$pos| elements before the end, e.g. -1 removes the last child. |
- Returns
- mixed The removed node, or PEAR_Error upon removal error. public
Definition at line 263 of file Node.php.
setAttribute |
( |
|
$name, |
|
|
|
$value = '' |
|
) |
| |
Sets an attribute for this node.
- Parameters
-
string | name Name of attribute to set |
string | value Value of attribute |
public
Definition at line 393 of file Node.php.
setContent |
( |
|
$content, |
|
|
|
$use_cdata_section = null |
|
) |
| |
Sets the content for this node.
- Parameters
-
string | content Node content to assign |
public
Definition at line 421 of file Node.php.
Unsets an attribute of this node.
- Parameters
-
string | $name | Name of attribute to unset |
public
Definition at line 406 of file Node.php.
XML_Tree_Node |
( |
|
$name, |
|
|
|
$content = '' , |
|
|
|
$attributes = array() , |
|
|
|
$lineno = null , |
|
|
|
$use_cdata_section = null |
|
) |
| |
Constructor
- Parameters
-
string | name Node name |
string | content Node content (text) |
array | attributes Attribute-hash for the node |
Definition at line 99 of file Node.php.
The documentation for this class was generated from the following file:
- /Users/webmaster/Desktop/squiz_matrix/php_includes/XML/Tree/Node.php