removeAttribute method

void removeAttribute(
  1. String name, {
  2. String? namespace,
})
inherited

Removes the attribute value with the given fully qualified name.

Both name and namespace can be a specific String; or '*' to match anything. If no namespace is provided, the fully qualified name is compared; otherwise only the local name is considered.

For example:

  • element.removeAttribute('xsd:name') removes the attribute with the fully qualified attribute name xsd:name.
  • element.removeAttribute('name', namespace: '*') removes the attribute with the local attribute name name no matter the namespace.
  • element.removeAttribute('*', namespace: 'http://www.w3.org/2001/XMLSchema') removes the attribute within the provided namespace URI.

Implementation

void removeAttribute(String name, {String? namespace}) =>
    setAttribute(name, null, namespace: namespace);