| 689 | Node.ENTITY_REFERENCE_NODE) |
| 690 | |
| 691 | def __init__(self, tagName, namespaceURI=EMPTY_NAMESPACE, prefix=None, |
| 692 | localName=None): |
| 693 | self.ownerDocument = None |
| 694 | self.parentNode = None |
| 695 | self.tagName = self.nodeName = tagName |
| 696 | self.prefix = prefix |
| 697 | self.namespaceURI = namespaceURI |
| 698 | self.childNodes = NodeList() |
| 699 | self.nextSibling = self.previousSibling = None |
| 700 | |
| 701 | # Attribute dictionaries are lazily created |
| 702 | # attributes are double-indexed: |
| 703 | # tagName -> Attribute |
| 704 | # URI,localName -> Attribute |
| 705 | # in the future: consider lazy generation |
| 706 | # of attribute objects this is too tricky |
| 707 | # for now because of headaches with |
| 708 | # namespaces. |
| 709 | self._attrs = None |
| 710 | self._attrsNS = None |
| 711 | |
| 712 | def _ensure_attributes(self): |
| 713 | if self._attrs is None: |