| 932 | self.setIdAttributeNode(idAttr) |
| 933 | |
| 934 | def setIdAttributeNode(self, idAttr): |
| 935 | if idAttr is None or not self.isSameNode(idAttr.ownerElement): |
| 936 | raise xml.dom.NotFoundErr() |
| 937 | if _get_containing_entref(self) is not None: |
| 938 | raise xml.dom.NoModificationAllowedErr() |
| 939 | if not idAttr._is_id: |
| 940 | idAttr._is_id = True |
| 941 | self._magic_id_nodes += 1 |
| 942 | self.ownerDocument._magic_id_count += 1 |
| 943 | _clear_id_cache(self) |
| 944 | |
| 945 | defproperty(Element, "attributes", |
| 946 | doc="NamedNodeMap of attributes on the element.") |