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

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.

Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:47:53


Concept topicConcept topic | Version 8.0.0.7 | bc28310_