public function parseAttributes(): array
    {
        $attributes = [];

        while ($this->moveToNextAttribute()) {
            if ($this->namespaceURI) {
                // Ignoring 'xmlns', it doesn't make any sense.
                if ('http://www.w3.org/2000/xmlns/' === $this->namespaceURI) {
                    continue;
                }

                $name = $this->getClark();
                $attributes[$name] = $this->value;
            } else {
                $attributes[$this->localName] = $this->value;
            }
        }
        $this->moveToElement();

        return $attributes;
    }
public function parseAttributes(): array
    {
        $attributes = [];

        while ($this->moveToNextAttribute()) {
            if ($this->namespaceURI) {
                // Ignoring 'xmlns', it doesn't make any sense.
                if ('http://www.w3.org/2000/xmlns/' === $this->namespaceURI) {
                    continue;
                }

                $name = $this->getClark();
                $attributes[$name] = $this->value;
            } else {
                $attributes[$this->localName] = $this->value;
            }
        }
        $this->moveToElement();

        return $attributes;
    }
public function parseAttributes ( ) : array { $ attributes = [ ] ; while ( $ this -> moveToNextAttribute ( ) ) { if ( $ this -> namespaceURI ) { // Ignoring 'xmlns', it doesn't make any sense. if ( 'http://www.w3.org/2000/xmlns/' === $ this -> namespaceURI ) { continue ; } $ name = $ this -> getClark ( ) ; $ attributes [ $ name ] = $ this -> value ; } else { $ attributes [ $ this -> localName ] = $ this -> value ; } } $ this -> moveToElement ( ) ; return $ attributes ; }
Grabs all the attributes from the current element, and returns them as a
key-value array.

If the attributes are part of the same namespace, they will simply be
short keys. If they are defined on a different namespace, the attribute
name will be retured in clark-notation.
Grabs all the attributes from the current element and returns them as a key - value array .