src/XML/DOM/FileEditor.php
protected function getNode( $nodePath )
	{
		$pathNodes	= explode( "/", $nodePath );
		$xmlNode	=& $this->xmlTree;
		while( $pathNodes )
		{
			$pathNode	= trim( array_shift( $pathNodes ) );
			$matches	= array();
			if( preg_match_all( "@^(.*)\[([0-9]+)\]$@", $pathNode, $matches ) )
			{
				$pathNode	= $matches[1][0];
				$itemNumber	= $matches[2][0];
				$nodes		= $xmlNode->getChildren( $pathNode );
				if( !isset( $nodes[$itemNumber] ) )
					throw new InvalidArgumentException( 'Node not existing.' );
				$xmlNode	=& $nodes[$itemNumber];
				continue;
			}
			$xmlNode	=& $xmlNode->getChild( $pathNode );
			continue;
		}
		return $xmlNode;
	}
protected function getNode( $nodePath )
	{
		$pathNodes	= explode( "/", $nodePath );
		$xmlNode	=& $this->xmlTree;
		while( $pathNodes )
		{
			$pathNode	= trim( array_shift( $pathNodes ) );
			$matches	= array();
			if( preg_match_all( "@^(.*)\[([0-9]+)\]$@", $pathNode, $matches ) )
			{
				$pathNode	= $matches[1][0];
				$itemNumber	= $matches[2][0];
				$nodes		= $xmlNode->getChildren( $pathNode );
				if( !isset( $nodes[$itemNumber] ) )
					throw new InvalidArgumentException( 'Node not existing.' );
				$xmlNode	=& $nodes[$itemNumber];
				continue;
			}
			$xmlNode	=& $xmlNode->getChild( $pathNode );
			continue;
		}
		return $xmlNode;
	}
protected function getNode ( $ nodePath ) { $ pathNodes = explode ( "/" , $ nodePath ) ; $ xmlNode = & $ this -> xmlTree ; while ( $ pathNodes ) { $ pathNode = trim ( array_shift ( $ pathNodes ) ) ; $ matches = array ( ) ; if ( preg_match_all ( "@^(.*)\[([0-9]+)\]$@" , $ pathNode , $ matches ) ) { $ pathNode = $ matches [ 1 ] [ 0 ] ; $ itemNumber = $ matches [ 2 ] [ 0 ] ; $ nodes = $ xmlNode -> getChildren ( $ pathNode ) ; if ( ! isset ( $ nodes [ $ itemNumber ] ) ) throw new InvalidArgumentException ( 'Node not existing.' ) ; $ xmlNode = & $ nodes [ $ itemNumber ] ; continue ; } $ xmlNode = & $ xmlNode -> getChild ( $ pathNode ) ; continue ; } return $ xmlNode ; }
Returns Node Object for a Node Path.
@access		public
@param		string		$nodePath		Path to Node in XML Tree
@return		bool
Returns Node Object for a Node Path .