xml.Attribute

An Attribute object represents an XML attribute information item. It represents only normal XML attributes, not special namespace binding XML attributes.

class xml.Attribute

Attributes

xml.Attribute.local_name

The local part of the attribute name. This does not include any namespace prefix or following colon.

xml.Attribute.namespace_name

The namespace name, if any, of the attribute. Otherwise, this attribute is None.

xml.Attribute.normalized_value

The normalized attribute value.

xml.Attribute.owner_element

The element information item which contains this information item in its attributes attribute.

xml.Attribute.prefix

The namespace prefix part of the attribute name. If the name is unprefixed, this attribute is None.

xml.Attribute.specified

A flag indicating whether this attribute was actually specified in the start-tag of its element, or was defaulted from the DTD.

Special methods

__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__