Index: branches/0.4/web/addons/job_monarch/libtoga.php
===================================================================
--- branches/0.4/web/addons/job_monarch/libtoga.php	(revision 747)
+++ branches/0.4/web/addons/job_monarch/libtoga.php	(revision 748)
@@ -537,4 +537,6 @@
             $error = sprintf( 'XML error: %s at %d', xml_error_string( xml_get_error_code( $this->parser ) ), xml_get_current_line_number( $this->parser ) );
         }
+        $handler = &$this->xmlhandler;
+        $handler->finishUp();
     }
 
@@ -929,57 +931,54 @@
     }
 
-    function stopElement( $parser, $name )
+    function finishUp( )
     {
         $nodes    = $this->nodes;
 
-        if( $name == "GANGLIA_XML" )
-        {
-            if( sizeof( $this->down_nodes ) > 0 )
-            {
-                foreach( $this->down_nodes as $reported => $dnodes )
-                {
-                    if( $reported == $this->heartbeat['time'] )
+        if( sizeof( $this->down_nodes ) > 0 )
+        {
+            foreach( $this->down_nodes as $reported => $dnodes )
+            {
+                if( $reported == $this->heartbeat['time'] )
+                {
+                    $domain = $dnodes[1];
+
+                    foreach( $dnodes[0] as $downhost )
                     {
-                        $domain = $dnodes[1];
-
-                        foreach( $dnodes[0] as $downhost )
+                        $downhost = $this->makeHostname( $downhost, $domain );
+
+                        if( isset( $nodes[$downhost] ) )
                         {
-                            $downhost = $this->makeHostname( $downhost, $domain );
-
-                            if( isset( $nodes[$downhost] ) )
-                            {
-                                // OMG PHP4 is fking stupid!
-                                // $nodes[$downhost]->setDown( 1 ) won't work here..
-                                //
-                                $mynode = $nodes[$downhost];
-                                $mynode->setDown( 1 );
-                                $nodes[$downhost] = $mynode;
-                            }
+                            // OMG PHP4 is fking stupid!
+                            // $nodes[$downhost]->setDown( 1 ) won't work here..
+                            //
+                            $mynode = $nodes[$downhost];
+                            $mynode->setDown( 1 );
+                            $nodes[$downhost] = $mynode;
                         }
                     }
                 }
             }
-
-            if( sizeof( $this->offline_nodes ) > 0 )
-            {
-                foreach( $this->offline_nodes as $reported => $onodes )
-                {
-                    if( $reported == $this->heartbeat['time'] )
+        }
+
+        if( sizeof( $this->offline_nodes ) > 0 )
+        {
+            foreach( $this->offline_nodes as $reported => $onodes )
+            {
+                if( $reported == $this->heartbeat['time'] )
+                {
+                    $domain = $onodes[1];
+
+                    foreach( $onodes[0] as $offlinehost )
                     {
-                        $domain = $onodes[1];
-
-                        foreach( $onodes[0] as $offlinehost )
+                        $offlinehost = $this->makeHostname( $offlinehost, $domain );
+
+                        if( isset( $nodes[$offlinehost] ) )
                         {
-                            $offlinehost = $this->makeHostname( $offlinehost, $domain );
-
-                            if( isset( $nodes[$offlinehost] ) )
-                            {
-                                // OMG PHP4 is fking stupid!
-                                // $nodes[$offlinehost]->setDown( 1 ) won't work here..
-                                //
-                                $mynode = $nodes[$offlinehost];
-                                $mynode->setOffline( 1 );
-                                $nodes[$offlinehost] = $mynode;
-                            }
+                            // OMG PHP4 is fking stupid!
+                            // $nodes[$offlinehost]->setDown( 1 ) won't work here..
+                            //
+                            $mynode = $nodes[$offlinehost];
+                            $mynode->setOffline( 1 );
+                            $nodes[$offlinehost] = $mynode;
                         }
                     }
@@ -989,4 +988,8 @@
 
         $this->nodes = $nodes;
+    }
+
+    function stopElement( $parser, $name )
+    {
     }
 
