Next / Previous / Contents / TCC Help System / NM Tech homepage

7. The Element class

Objects in class Element represent XML elements. Such objects have this attribute:

.nodeName

The qualified name of the element.

Methods on Element objects are shown below.

7.1. Element.getAttributeNS()

This method is used to retrieve the value of the attribute of a given name of an element node E.

E.getAttributeNS(nsURI, localName)

If E has an attribute whose namespace URI matches nsURI and whose local name matches localName, return the value of that attribute, otherwise return an empty string.

Note

Where methods take an nsURI argument, pass the desired namespace URI as an argument.

For the default namespace, pass None to the nsURI argument. For example, if E is an element, this call:

E.getAttributeNS(None, "align")

returns the value of the align attribute in the default namespace, if there is such an attribute.