Google\Spreadsheet\Util::extractAttributeFromXml PHP Method

extractAttributeFromXml() public static method

Get a specific attribute in a namespaced tag
public static extractAttributeFromXml ( SimpleXMLElement $xml, $namespacePrefix, $attribute ) : string
$xml SimpleXMLElement
return string
    public static function extractAttributeFromXml(\SimpleXMLElement $xml, $namespacePrefix, $attribute)
    {
        return $xml->children($namespacePrefix, true)->attributes()[$attribute]->__toString();
    }

Usage Example

 /**
  * Constructor
  * 
  * @param \SimpleXMLElement $xml
  * @param string            $postUrl
  */
 public function __construct($xml, $postUrl)
 {
     $this->xml = $xml;
     $this->postUrl = $postUrl;
     $this->setCellLocation();
     $this->content = $xml->content->__toString();
     $this->inputValue = Util::extractAttributeFromXml($xml, "gs", "inputValue");
 }
All Usage Examples Of Google\Spreadsheet\Util::extractAttributeFromXml