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

7.5. Element.setAttributeNS()

This method insures that element E has an attribute with a given name and value.

E.setAttributeNS(nsURI, qName, value)

If E has no attribute in namespace nsURI and qualified name qName, such an attribute is created and set to the given value.

If there is an existing attribute by that name, its value is replaced by value.

To create an attribute in the default namespace, pass None as the first argument, and use an unqualified qName.

To create an attribute with a namespace qualifier, pass the namespace URI as the first argument, and use a qualified name of the form "prefix:localName". You are responsible for being consistent about the association between a given namespace prefixes and its namespace URI.