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

Method parse

Lib/xml/sax/expatreader.py:95–109  ·  view source on GitHub ↗

Parse an XML document from a URL or an InputSource.

(self, source)

Source from the content-addressed store, hash-verified

93 # XMLReader methods
94
95 def parse(self, source):
96 "Parse an XML document from a URL or an InputSource."
97 source = saxutils.prepare_input_source(source)
98
99 self._source = source
100 try:
101 self.reset()
102 self._cont_handler.setDocumentLocator(ExpatLocator(self))
103 xmlreader.IncrementalParser.parse(self, source)
104 except:
105 # bpo-30264: Close the source on error to not leak resources:
106 # xml.sax.parse() doesn't give access to the underlying parser
107 # to the caller
108 self._close_source()
109 raise
110
111 def prepareParser(self, source):
112 if source.getSystemId() is not None:

Callers 2

external_entity_refMethod · 0.45
expatreader.pyFile · 0.45

Calls 4

resetMethod · 0.95
_close_sourceMethod · 0.95
ExpatLocatorClass · 0.85
setDocumentLocatorMethod · 0.45

Tested by

no test coverage detected