Lines Matching refs:attr
365 # Add the single child node that represents the value of the attr
717 for attr in list(self._attrs.values()):
718 attr.unlink()
748 attr = self.getAttributeNode(attname)
749 if attr is None:
750 attr = Attr(attname)
751 attr.value = value # also sets nodeValue
752 attr.ownerDocument = self.ownerDocument
753 self.setAttributeNode(attr)
754 elif value != attr.value:
755 attr.value = value
756 if attr.isId:
761 attr = self.getAttributeNodeNS(namespaceURI, localname)
762 if attr is None:
763 attr = Attr(qualifiedName, namespaceURI, localname, prefix)
764 attr.value = value
765 attr.ownerDocument = self.ownerDocument
766 self.setAttributeNode(attr)
768 if value != attr.value:
769 attr.value = value
770 if attr.isId:
772 if attr.prefix != prefix:
773 attr.prefix = prefix
774 attr.nodeName = qualifiedName
786 def setAttributeNode(self, attr):
787 if attr.ownerElement not in (None, self):
790 old1 = self._attrs.get(attr.name, None)
793 old2 = self._attrsNS.get((attr.namespaceURI, attr.localName), None)
796 _set_attribute_node(self, attr)
798 if old1 is not attr:
802 if old2 is not attr:
811 attr = self._attrs[name]
814 self.removeAttributeNode(attr)
820 attr = self._attrsNS[(namespaceURI, localName)]
823 self.removeAttributeNode(attr)
940 def _set_attribute_node(element, attr):
943 element._attrs[attr.name] = attr
944 element._attrsNS[(attr.namespaceURI, attr.localName)] = attr
949 attr.ownerElement = element
1769 for attr in node.attributes.values():
1770 if attr.namespaceURI:
1771 if info.isIdNS(attr.namespaceURI, attr.localName):
1772 self._id_cache[attr.value] = node
1773 if attr.value == id:
1777 elif info.isId(attr.name):
1778 self._id_cache[attr.value] = node
1779 if attr.value == id:
1783 elif attr._is_id:
1784 self._id_cache[attr.value] = node
1785 if attr.value == id:
1790 for attr in node.attributes.values():
1791 if attr._is_id:
1792 self._id_cache[attr.value] = node
1793 if attr.value == id:
1901 for attr in node.attributes.values():
1902 clone.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.value)
1903 a = clone.getAttributeNodeNS(attr.namespaceURI, attr.localName)
1904 a.specified = attr.specified