MCPcopy Index your code
hub / github.com/python/cpython / Document

Class Document

Lib/xml/dom/minidom.py:1557–1894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1555 node.ownerDocument._id_search_stack= None
1556
1557class 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

Callers 15

testDocumentAsyncAttrMethod · 0.90
testLegalChildrenMethod · 0.90
testElementMethod · 0.90
testAddAttrMethod · 0.90
testDeleteAttrMethod · 0.90
testRemoveAttrMethod · 0.90
testRemoveAttrNSMethod · 0.90
testHasAttributeMethod · 0.90
testGetAttributeMethod · 0.90
testGetAttributeNSMethod · 0.90

Calls 1

DOMImplementationClass · 0.85

Tested by 15

testDocumentAsyncAttrMethod · 0.72
testLegalChildrenMethod · 0.72
testElementMethod · 0.72
testAddAttrMethod · 0.72
testDeleteAttrMethod · 0.72
testRemoveAttrMethod · 0.72
testRemoveAttrNSMethod · 0.72
testHasAttributeMethod · 0.72
testGetAttributeMethod · 0.72
testGetAttributeNSMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…