Package lxml :: Module etree :: Class _FeedParser |
[hide private]
[frames] | no frames]

# Class _FeedParser

     object --+
              |
    _BaseParser --+
                  |
                 _FeedParser

Known Subclasses:
  - XMLParser
  - , HTMLParser

Instance Methods | [hide private]
a new object with type S, a subtype of T |
__new__(T, S, ...) |
close(self) Terminates feeding data to this parser. This tells the parser to process any remaining data in the feed buffer, and then returns the root Element of the tree that was parsed. |
feed(self, data) Feeds data to the parser. The argument should be an 8-bit string buffer containing encoded data, although Unicode is supported as long as both string types are not mixed. |
Inherited from `_BaseParser`: `__init__`, `copy`, `makeelement`, `setElementClassLookup`, `set_element_class_lookup` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]
| feed_error_log The error log of the last (or current) run of the feed parser.
Inherited from `_BaseParser`: `error_log`, `resolvers`, `target`, `version` Inherited from `object`: `__class__`

Method Details | [hide private]

### __new__(T, S, ...) |
Returns: a new object with type S, a subtype of T Overrides: object.__new__

### close(self) |
Terminates feeding data to this parser. This tells the parser to process any remaining data in the feed buffer, and then returns the root Element of the tree that was parsed. This method must be called after passing the last chunk of data into the `feed()` method. It should only be called when using the feed parser interface, all other usage is undefined.

### feed(self, data) |
Feeds data to the parser. The argument should be an 8-bit string buffer containing encoded data, although Unicode is supported as long as both string types are not mixed. This is the main entry point to the consumer interface of a parser. The parser will parse as much of the XML stream as it can on each call. To finish parsing or to reset the parser, call the `close()` method. Both methods may raise ParseError if errors occur in the input data. If an error is raised, there is no longer a need to call `close()`. The feed parser interface is independent of the normal parser usage. You can use the same parser as a feed parser and in the `parse()` function concurrently.

Property Details | [hide private]

### feed_error_log The error log of the last (or current) run of the feed parser. Note that this is local to the feed parser and thus is different from what the `error_log` property returns.