Index: trunk/src/inc/FileHandler.class.php
===================================================================
--- trunk/src/inc/FileHandler.class.php	(revision 7639)
+++ trunk/src/inc/FileHandler.class.php	(revision 7640)
@@ -30,5 +30,4 @@
 			trigger_log(SYSLOG_INFO, 'Reading from file "' . $filename . '" is done', __FILE__, __LINE__);
 		} catch (Exception $err) {
-			// TODO: Better error description
 			trigger_log(SYSLOG_ERR, 'Reading from file "' . $filename . '" failed', __FILE__, __LINE__);
 		}
Index: trunk/src/inc/KMLFile.class.php
===================================================================
--- trunk/src/inc/KMLFile.class.php	(revision 7639)
+++ trunk/src/inc/KMLFile.class.php	(revision 7640)
@@ -93,5 +93,38 @@
 	}
 
-	public function parseFile($file) {
+	public function parseLocationFile($file) {
+		//preg_match_all('#\[(^\/.+?)\]#is', $file, $matches);
+		$nodesCount = preg_match_all('/\[[a-zA-Z0-9]*\]/i', $file, $nodes, PREG_OFFSET_CAPTURE);
+		for ($i = 0; $i < $nodesCount; $i++) {
+			$location	= $this->findInLocationFile($file, 'location', $nodes[0][$i][1]);
+			$status		= $this->findInLocationFile($file, 'status', $nodes[0][$i][1]);
+			$latitude	= $this->findInLocationFile($file, 'latitude', $nodes[0][$i][1]);
+			$longitude	= $this->findInLocationFile($file, 'longitude', $nodes[0][$i][1]);
+			$interfaces	= $this->findInLocationFile($file, 'interfaces', $nodes[0][$i][1]);
+			$masterip	= $this->findInLocationFile($file, 'masterip', $nodes[0][$i][1]);
+			$nodetype	= $this->findInLocationFile($file, 'nodetype', $nodes[0][$i][1]);
+			$name		= $this->findInLocationFile($file, 'name', $nodes[0][$i][1]);
+
+			$placemark = new KMLPlacemark();
+			$placemark->setName($name);
+			$placemark->setDescription('Naam: ' . $name . '<br/>Locatie: ' . $location . '<br/>Status: ' . $status . '<br/>Latitude: ' . $latitude . '<br/>Longitude: ' . $longitude . '<br/>Interfaces: ' . $interfaces . '<br/>Master IP: ' . $masterip . '<br/>Node type: ' . $nodetype);
+			$placemark->setLongitude($longitude);
+			$placemark->setLatitude($latitude);
+			$placemark->setStyle($status == 'up' ? 'greenArrowIcon' : 'redArrowIcon');
+			$this->addPlacemark($placemark);
+		}
+	}
+
+	private function findInLocationFile($file, $keyword, $offset) {
+		$start	= strpos($file, $keyword, $offset) + strlen($keyword . ' = ');
+		$end	= strpos($file, "\n", $start);
+		return substr($file, $start, $end - $start);
+	}
+
+	public function parseStatusFile($file) {
+		/*
+		 * TODO: Needs to be rebuild so it doesn't create a new KMLFile object,
+		 * but add the KMLPlacemarks to the current object.
+		 */
 		$fileContents = explode("\r\n", $file);
 
Index: trunk/src/index.php
===================================================================
--- trunk/src/index.php	(revision 7639)
+++ trunk/src/index.php	(revision 7640)
@@ -31,11 +31,16 @@
 echo $kml->toString();
 
+// Now let's try reading from files and parsing the data in the files.
+// First off, we create a new KMLFile object
+$kmlFile = new KMLFile();
+
 // Let's try to read the node location file
 $nodeLocation = new FileHandler($config['node_location_file']);
-// TODO: Needs parsing
+$kmlFile->parseLocationFile($nodeLocation->getFile());
+echo $kmlFile->toString();
 
 // Let's try to read the node status file
 $nodeStatus = new FileHandler($config['node_status_file']);
-$kmlFile = KMLFile::parseFile($nodeStatus->getFile());
+$kmlFile->parseStatusFile($nodeStatus->getFile());
 /*
  * TODO: Needs better parsing of the file now we have two seperate
