src/Parser.php
private function parseElementAttributes(DOMElement $xml)
    {
        $attrs        = [];
        $elementAttrs = $xml->xpath('./@*');

        if (0 === $elementAttrs->length) {
            return $attrs;
        }

        foreach ($elementAttrs as $key => $attribute) {
            $value = static::getPhpValue($attribute->nodeValue, null, $this);
            $name = $this->normalizeKey($attribute->nodeName);
            $attrs[$this->prefixKey($name, $attribute->prefix ?: null)] = $value;
        }

        return [$this->getAttributesKey() => $attrs];
    }
private function parseElementAttributes(DOMElement $xml)
    {
        $attrs        = [];
        $elementAttrs = $xml->xpath('./@*');

        if (0 === $elementAttrs->length) {
            return $attrs;
        }

        foreach ($elementAttrs as $key => $attribute) {
            $value = static::getPhpValue($attribute->nodeValue, null, $this);
            $name = $this->normalizeKey($attribute->nodeName);
            $attrs[$this->prefixKey($name, $attribute->prefix ?: null)] = $value;
        }

        return [$this->getAttributesKey() => $attrs];
    }
private function parseElementAttributes ( DOMElement $ xml ) { $ attrs = [ ] ; $ elementAttrs = $ xml -> xpath ( './@*' ) ; if ( 0 === $ elementAttrs -> length ) { return $ attrs ; } foreach ( $ elementAttrs as $ key => $ attribute ) { $ value = static :: getPhpValue ( $ attribute -> nodeValue , null , $ this ) ; $ name = $ this -> normalizeKey ( $ attribute -> nodeName ) ; $ attrs [ $ this -> prefixKey ( $ name , $ attribute -> prefix ? : null ) ] = $ value ; } return [ $ this -> getAttributesKey ( ) => $ attrs ] ; }
Parse element attributes into an array.

@param DOMElement $xml

@return array
Parse element attributes into an array .