GetAttributeWithNamespace method

String? GetAttributeWithNamespace(
  1. String attributeName,
  2. String namespace
)

Implementation

String? GetAttributeWithNamespace(String attributeName, String namespace) {
  var namespacePrefix = _namespaces.keys
      .firstWhereOrNull((prefix) => _namespaces[prefix] == namespace);
  return (_events.current as XmlStartElementEvent)
      .attributes
      .firstWhereOrNull((attr) =>
          attr.localName == attributeName &&
          attr.namespacePrefix == namespacePrefix)
      ?.value;
}