SimpleXMLIterator Class Reference
[Internal classes]

recursive SimpleXML_Element iterator More...

Inheritance diagram for SimpleXMLIterator:

Inheritance graph
{RecursiveIterator\n||+ getChildren()\l+ hasChildren()\l}{Iterator\n||+ current()\l+ key()\l+ next()\l+ rewind()\l+ valid()\l}{Traversable\n||}{Countable\n||+ count()\l}
[legend]
Collaboration diagram for SimpleXMLIterator:

Collaboration graph
{RecursiveIterator\n||+ getChildren()\l+ hasChildren()\l}{Iterator\n||+ current()\l+ key()\l+ next()\l+ rewind()\l+ valid()\l}{Traversable\n||}{Countable\n||+ count()\l}
[legend]
List of all members.

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 1072 of file spl.php.


Member Function Documentation

SimpleXMLIterator::count (  ) 

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

Implements Countable.

Definition at line 1084 of file spl.php.

01084 {}

SimpleXMLIterator::current (  ) 

Return the current element.

Implements Iterator.

Definition at line 1093 of file spl.php.

01093 {}

SimpleXMLIterator::getChildren (  ) 

Returns:
a SimpleXMLIterator for the current node.

Implements RecursiveIterator.

Definition at line 1080 of file spl.php.

01080 {}  

SimpleXMLIterator::hasChildren (  ) 

Returns:
whether the current node has sub nodes.

Implements RecursiveIterator.

Definition at line 1076 of file spl.php.

01076 {}  

SimpleXMLIterator::key (  ) 

Return the key of the current element.

Implements Iterator.

Definition at line 1096 of file spl.php.

01096 {}

SimpleXMLIterator::next (  ) 

Move forward to next element.

Implements Iterator.

Definition at line 1099 of file spl.php.

01099 {}

SimpleXMLIterator::rewind (  ) 

Rewind the Iterator to the first element.

Implements Iterator.

Definition at line 1087 of file spl.php.

01087 {}

SimpleXMLIterator::valid (  ) 

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

Implements Iterator.

Definition at line 1090 of file spl.php.

01090 {}


The documentation for this class was generated from the following file:
Generated on Thu Apr 26 01:07:31 2007 for SPL-StandardPHPLibrary by  doxygen 1.5.2