getElementsByTagName("almobj"); for ($i=0; $i<$alMObjListDOM->length; $i++) { $almobj = $alMObjListDOM->item($i); $id_node = $almobj->attributes->getNamedItem("id"); $address_node = $almobj->getElementsByTagName("addr")->item(0); $name_node = $almobj->getElementsByTagName("name")->item(0); $almListDOM = $almobj->getElementsByTagName("alarm"); for ($j=0; $j<$almListDOM->length; $j++) { $alarm = $almListDOM->item($j); $alm_id = $alarm->attributes->getNamedItem("id"); $alm_spec = $alarm->getElementsByTagName("alm_spec")->item(0); $evt_time = $alarm->getElementsByTagName("evt_time")->item(0); $date = $alarm->getElementsByTagName("rec_date")->item(0); $status = $alarm->getElementsByTagName("alm_stat")->item(0); $serv_infl = $alarm->getElementsByTagName("serv_infl")->item(0); $almList[] = new Alarm($alm_id->nodeValue, "$alm_spec->textContent", "$evt_time->textContent", "$date->textContent", "$status->textContent", "$serv_infl->textContent"); } $alMObjList[] = new AlMObj($id_node->nodeValue, "$address_node->textContent", "$name_node->textContent", $almList); unset($almList); } return $alMObjList; } var $almobj_id; // alarming managed object ID (numerical) var $address; // alarming managed object address var $almobj; // identifier (i.e. a text string) var $alm_arr; // array of Alarm objects function __construct($almobj_id,$address,$almobj,$alm_arr) { $this->almobj_id = $almobj_id; $this->address = $address; $this->almobj = $almobj; $this->alm_arr = $alm_arr; } } class Alarm { // var $alm_obj_id; // maybe alarming managed object ID the alarm is attached to var $alm_id; // alarm ID (numerical) var $alm_spec; // alarm specification var $evt_time; // timestamp var $date; // date var $status; // alarm status var $serv_infl; // service influence function __construct($alm_id,$alm_spec,$evt_time,$date,$status,$serv_infl) { $this->alm_id = $alm_id; $this->alm_spec = $alm_spec; $this->date = $date; $this->evt_time = $evt_time; $this->status = $status; $this->serv_infl = $serv_infl; } }