| 1555 | node.ownerDocument._id_search_stack= None |
| 1556 | |
| 1557 | class Document(Node, DocumentLS): |
| 1558 | __slots__ = ('_elem_info', 'doctype', |
| 1559 | '_id_search_stack', 'childNodes', '_id_cache') |
| 1560 | _child_node_types = (Node.ELEMENT_NODE, Node.PROCESSING_INSTRUCTION_NODE, |
| 1561 | Node.COMMENT_NODE, Node.DOCUMENT_TYPE_NODE) |
| 1562 | |
| 1563 | implementation = DOMImplementation() |
| 1564 | nodeType = Node.DOCUMENT_NODE |
| 1565 | nodeName = "#document" |
| 1566 | nodeValue = None |
| 1567 | attributes = None |
| 1568 | parentNode = None |
| 1569 | previousSibling = nextSibling = None |
| 1570 | |
| 1571 | |
| 1572 | # Document attributes from Level 3 (WD 9 April 2002) |
| 1573 | |
| 1574 | actualEncoding = None |
| 1575 | encoding = None |
| 1576 | standalone = None |
| 1577 | version = None |
| 1578 | strictErrorChecking = False |
| 1579 | errorHandler = None |
| 1580 | documentURI = None |
| 1581 | |
| 1582 | _magic_id_count = 0 |
| 1583 | |
| 1584 | def __init__(self): |
| 1585 | self.doctype = None |
| 1586 | self.childNodes = NodeList() |
| 1587 | # mapping of (namespaceURI, localName) -> ElementInfo |
| 1588 | # and tagName -> ElementInfo |
| 1589 | self._elem_info = {} |
| 1590 | self._id_cache = {} |
| 1591 | self._id_search_stack = None |
| 1592 | |
| 1593 | def _get_elem_info(self, element): |
| 1594 | if element.namespaceURI: |
| 1595 | key = element.namespaceURI, element.localName |
| 1596 | else: |
| 1597 | key = element.tagName |
| 1598 | return self._elem_info.get(key) |
| 1599 | |
| 1600 | def _get_actualEncoding(self): |
| 1601 | return self.actualEncoding |
| 1602 | |
| 1603 | def _get_doctype(self): |
| 1604 | return self.doctype |
| 1605 | |
| 1606 | def _get_documentURI(self): |
| 1607 | return self.documentURI |
| 1608 | |
| 1609 | def _get_encoding(self): |
| 1610 | return self.encoding |
| 1611 | |
| 1612 | def _get_errorHandler(self): |
| 1613 | return self.errorHandler |
| 1614 |
searching dependent graphs…