MCPcopy Index your code
hub / github.com/RustPython/RustPython / setDocumentLocator

Method setDocumentLocator

Lib/xml/sax/handler.py:57–78  ·  view source on GitHub ↗

Called by the parser to give the application a locator for locating the origin of document events. SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this

(self, locator)

Source from the content-addressed store, hash-verified

55 self._locator = None
56
57 def setDocumentLocator(self, locator):
58 """Called by the parser to give the application a locator for
59 locating the origin of document events.
60
61 SAX parsers are strongly encouraged (though not absolutely
62 required) to supply a locator: if it does so, it must supply
63 the locator to the application by invoking this method before
64 invoking any of the other methods in the DocumentHandler
65 interface.
66
67 The locator allows the application to determine the end
68 position of any document-related event, even if the parser is
69 not reporting an error. Typically, the application will use
70 this information for reporting its own errors (such as
71 character content that does not match an application's
72 business rules). The information returned by the locator is
73 probably not sufficient for use with a search engine.
74
75 Note that the locator will return correct information only
76 during the invocation of the events in this interface. The
77 application should not attempt to use it at any other time."""
78 self._locator = locator
79
80 def startDocument(self):
81 """Receive notification of the beginning of a document.

Callers 1

parseMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected