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