Returns the value of the specified attribute. Returns the value of the element's attribute named attname as a string. An empty string is returned if the element does not have such an attribute. Note that an empty string may also be returned as an explicitly given att
(self, attname)
| 732 | Node.unlink(self) |
| 733 | |
| 734 | def getAttribute(self, attname): |
| 735 | """Returns the value of the specified attribute. |
| 736 | |
| 737 | Returns the value of the element's attribute named attname as |
| 738 | a string. An empty string is returned if the element does not |
| 739 | have such an attribute. Note that an empty string may also be |
| 740 | returned as an explicitly given attribute value, use the |
| 741 | hasAttribute method to distinguish these two cases. |
| 742 | """ |
| 743 | if self._attrs is None: |
| 744 | return "" |
| 745 | try: |
| 746 | return self._attrs[attname].value |
| 747 | except KeyError: |
| 748 | return "" |
| 749 | |
| 750 | def getAttributeNS(self, namespaceURI, localName): |
| 751 | if self._attrsNS is None: |
no outgoing calls