Location: PHPKode > scripts > UML 2 Classes > uml-2-classes/src/Classes/XMI/XMIParser.class.php
<?
/**
 * Core Parser for the XMI File
 *
 *@author	Teoni Valois da Mota Silva
 *@name		XMIParser
 *@package	XMI
 *@version 	0.1.3
 *
 */

class XMIParser{
	
	/**
	 * The XMI data
	 *
	 * @var String
	 */
	var $data;
	
	/**
	 * XMIParser's Object constructor
	 *
	 * @param String $xmiFile
	 */
	function XMIParser($file){
		$xml = new XMLParser(); 
		$xml->parseFile($file); 
		$tree = $xml->getTree();
		$this->data = $tree['XMI'][0]['XMI.content'][0]['UML:Model'][0]['UML:Namespace.ownedElement'][0];
	}
	
	/**
	 * XMIParser's Object destructor
	 *
	 */
	function __destruct(){
		$this->data = null;
	}
	
	/**
	 * Returns an Array containing all the XMI code
	 * between the UML:Model tags
	 * 
	 * @return Array
	 */
	function getData(){
		return $this->data;
	}
}
?>
Return current item: UML 2 Classes