WebSphere Message Broker, Version 8.0.0.7
Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS
See information about the latest product version
See information about the latest product version
Iterating over elements
Use the MbsElementIterator class to provide sequential iteration over elements in the message tree.
You can use an MbsElementIterator in a foreach() statement to iterate over the children of an MbsElement. The foreach() statement automatically calls methods on the iterator object to step through all the elements.
The following example shows how you can use MbsElementIterator
to iterate over elements:
$it = new MbsElementIterator($input_assembly->XMLNSC->getFirstChild());
echo "\nIterating using an MbsElementIterator in a foreach loop\n";
foreach($it as $key=>$value)
{
echo $key.'='.$value."\n";
}
For more information about the MbsElementIterator class, see MbsElementIterator.