(self, data, isFinal=False)
| 198 | # IncrementalParser methods |
| 199 | |
| 200 | def feed(self, data, isFinal=False): |
| 201 | if not self._parsing: |
| 202 | self.reset() |
| 203 | self._parsing = True |
| 204 | self._cont_handler.startDocument() |
| 205 | |
| 206 | try: |
| 207 | # The isFinal parameter is internal to the expat reader. |
| 208 | # If it is set to true, expat will check validity of the entire |
| 209 | # document. When feeding chunks, they are not normally final - |
| 210 | # except when invoked from close. |
| 211 | self._parser.Parse(data, isFinal) |
| 212 | except expat.error as e: |
| 213 | exc = SAXParseException(expat.ErrorString(e.code), e, self) |
| 214 | # FIXME: when to invoke error()? |
| 215 | self._err_handler.fatalError(exc) |
| 216 | |
| 217 | def flush(self): |
| 218 | if self._parser is None: |
no test coverage detected