forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpulldom.pyi
More file actions
87 lines (78 loc) · 3.11 KB
/
Copy pathpulldom.pyi
File metadata and controls
87 lines (78 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
from typing import IO, Any, Sequence, Tuple, Union
from typing_extensions import Literal
from xml.dom.minidom import Document, DOMImplementation, Element, Text
from xml.sax.handler import ContentHandler
from xml.sax.xmlreader import XMLReader
START_ELEMENT: Literal["START_ELEMENT"]
END_ELEMENT: Literal["END_ELEMENT"]
COMMENT: Literal["COMMENT"]
START_DOCUMENT: Literal["START_DOCUMENT"]
END_DOCUMENT: Literal["END_DOCUMENT"]
PROCESSING_INSTRUCTION: Literal["PROCESSING_INSTRUCTION"]
IGNORABLE_WHITESPACE: Literal["IGNORABLE_WHITESPACE"]
CHARACTERS: Literal["CHARACTERS"]
DocumentFactory = Union[DOMImplementation, None]
Node = Union[Document, Element, Text]
Event = Tuple[
Literal[
Literal["START_ELEMENT"],
Literal["END_ELEMENT"],
Literal["COMMENT"],
Literal["START_DOCUMENT"],
Literal["END_DOCUMENT"],
Literal["PROCESSING_INSTRUCTION"],
Literal["IGNORABLE_WHITESPACE"],
Literal["CHARACTERS"],
],
Node,
]
class PullDOM(ContentHandler):
document: Union[Document, None]
documentFactory: DocumentFactory
firstEvent: Any
lastEvent: Any
elementStack: Sequence[Any]
pending_events: Sequence[Any]
def __init__(self, documentFactory: DocumentFactory = ...) -> None: ...
def pop(self) -> Element: ...
def setDocumentLocator(self, locator) -> None: ...
def startPrefixMapping(self, prefix, uri) -> None: ...
def endPrefixMapping(self, prefix) -> None: ...
def startElementNS(self, name, tagName, attrs) -> None: ...
def endElementNS(self, name, tagName) -> None: ...
def startElement(self, name, attrs) -> None: ...
def endElement(self, name) -> None: ...
def comment(self, s) -> None: ...
def processingInstruction(self, target, data) -> None: ...
def ignorableWhitespace(self, chars) -> None: ...
def characters(self, chars) -> None: ...
def startDocument(self) -> None: ...
def buildDocument(self, uri, tagname): ...
def endDocument(self) -> None: ...
def clear(self) -> None: ...
class ErrorHandler:
def warning(self, exception) -> None: ...
def error(self, exception) -> None: ...
def fatalError(self, exception) -> None: ...
class DOMEventStream:
stream: IO[bytes]
parser: XMLReader
bufsize: int
def __init__(self, stream: IO[bytes], parser: XMLReader, bufsize: int) -> None: ...
pulldom: Any
def __getitem__(self, pos): ...
def __next__(self): ...
def __iter__(self): ...
def getEvent(self) -> Event: ...
def expandNode(self, node: Node) -> None: ...
def reset(self) -> None: ...
def clear(self) -> None: ...
class SAX2DOM(PullDOM):
def startElementNS(self, name, tagName, attrs) -> None: ...
def startElement(self, name, attrs) -> None: ...
def processingInstruction(self, target, data) -> None: ...
def ignorableWhitespace(self, chars) -> None: ...
def characters(self, chars) -> None: ...
default_bufsize: int
def parse(stream_or_string: str | IO[bytes], parser: XMLReader | None = ..., bufsize: int | None = ...) -> DOMEventStream: ...
def parseString(string: str, parser: XMLReader | None = ...) -> DOMEventStream: ...