You are here

public function XMLAttribute::resolve in GraphQL 8.4

Returns the attribute value on the DOMElement.

Parameters

\DOMElement $dom: The source (root) DOM element.

string $name: The name of the attribute.

Return value

string

File

src/Plugin/GraphQL/DataProducer/XML/XMLAttribute.php, line 39

Class

XMLAttribute
XML attribute data producer.

Namespace

Drupal\graphql\Plugin\GraphQL\DataProducer\XML

Code

public function resolve(\DOMElement $dom, $name) {
  return $dom
    ->getAttribute($name);
}