src/XML/Element.php
public function getAttribute( $name, $nsPrefix = NULL )
	{
		$data	= $nsPrefix ? $this->attributes( $nsPrefix, TRUE ) : $this->attributes();
		if( !isset( $data[$name] ) )
			throw new RuntimeException( 'Attribute "'.( $nsPrefix ? $nsPrefix.':'.$name : $name ).'" is not set' );
		return (string) $data[$name];
	}
public function getAttribute( $name, $nsPrefix = NULL )
	{
		$data	= $nsPrefix ? $this->attributes( $nsPrefix, TRUE ) : $this->attributes();
		if( !isset( $data[$name] ) )
			throw new RuntimeException( 'Attribute "'.( $nsPrefix ? $nsPrefix.':'.$name : $name ).'" is not set' );
		return (string) $data[$name];
	}
public function getAttribute ( $ name , $ nsPrefix = NULL ) { $ data = $ nsPrefix ? $ this -> attributes ( $ nsPrefix , TRUE ) : $ this -> attributes ( ) ; if ( ! isset ( $ data [ $ name ] ) ) throw new RuntimeException ( 'Attribute "' . ( $ nsPrefix ? $ nsPrefix . ':' . $ name : $ name ) . '" is not set' ) ; return ( string ) $ data [ $ name ] ; }
Returns the value of an attribute by it's name.
@access		public
@param		string		$name		Name of attribute
@param		string		$nsPrefix	Namespace prefix of attribute
@return		bool
@throws		RuntimeException		if attribute is not set
Returns the value of an attribute by it s name .