SPL-StandardPHPLibrary
Public Member Functions | List of all members
SimpleXMLIterator Class Reference
Inheritance diagram for SimpleXMLIterator:
Inheritance graph
Collaboration diagram for SimpleXMLIterator:
Collaboration graph

Public Member Functions

 count ()
 
 current ()
 
 getChildren ()
 
 hasChildren ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 

Detailed Description

recursive SimpleXML_Element iterator

Since
PHP 5.0

The SimpleXMLIterator implements the RecursiveIterator interface. This allows iteration over all elements using foreach or an appropriate while construct, just like SimpleXMLElement does. When using the foreach construct, you will also iterate over the subelements. For every element which has subelements, hasChildren() returns true. This will trigger a call to getChildren() which returns the iterator for that sub element.

Definition at line 1094 of file spl.php.

Member Function Documentation

SimpleXMLIterator::count ( )
Returns
number of elements/attributes seen with foreach()

Implements Countable.

Definition at line 1106 of file spl.php.

1106 {}
SimpleXMLIterator::current ( )

Return the current element.

Implements Iterator.

Definition at line 1115 of file spl.php.

1115 {}
SimpleXMLIterator::getChildren ( )
Returns
a SimpleXMLIterator for the current node.

Implements RecursiveIterator.

Definition at line 1102 of file spl.php.

1102 {}
SimpleXMLIterator::hasChildren ( )
Returns
whether the current node has sub nodes.

Implements RecursiveIterator.

Definition at line 1098 of file spl.php.

1098 {}
SimpleXMLIterator::key ( )

Return the key of the current element.

Implements Iterator.

Definition at line 1118 of file spl.php.

1118 {}
SimpleXMLIterator::next ( )

Move forward to next element.

Implements Iterator.

Definition at line 1121 of file spl.php.

1121 {}
SimpleXMLIterator::rewind ( )

Rewind the Iterator to the first element.

Implements Iterator.

Definition at line 1109 of file spl.php.

1109 {}
SimpleXMLIterator::valid ( )

Check if there is a current element after calls to rewind() or next().

Implements Iterator.

Definition at line 1112 of file spl.php.

1112 {}

The documentation for this class was generated from the following file: