Home | Trees | Index | Help |
|
---|
Package lxml :: Module etree :: Class iterparse |
|
object
--+ |_BaseParser
--+ | iterparse
Incremental parser. Parses XML into a tree and generates tuples (event, element) in a SAX-like fashion. ``event`` is any of 'start', 'end', 'start-ns', 'end-ns'.
For 'start' and 'end', ``element`` is the Element that the parser just found opening or closing. For 'start-ns', it is a tuple (prefix, URI) of a new namespace declaration. For 'end-ns', it is simply None. Note that all start and end events are guaranteed to be properly nested.
The keyword argument ``events`` specifies a sequence of event type names that should be generated. By default, only 'end' events will be generated.
The additional ``tag`` argument restricts the 'start' and 'end' events to those elements that match the given tag. By default, events are generated for all elements. Note that the 'start-ns' and 'end-ns' events are not impacted by this restriction.
The other keyword arguments in the constructor are mainly based on the libxml2 parser configuration. A DTD will also be loaded if validation or attribute default values are requested.
Available boolean keyword arguments: * attribute_defaults - read default attributes from DTD * dtd_validation - validate (if DTD is available) * load_dtd - use DTD for parsing * no_network - prevent network access * remove_blank_text - discard blank text nodes * remove_comments - discard comments * remove_pis - discard processing instructionsMethod Summary | |
---|---|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature | |
x.__iter__() <==> iter(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
x.next() -> the next value, or raise StopIteration | |
Inherited from _BaseParser | |
Create a new parser with the same configuration. | |
Creates a new element associated with this parser. | |
Set a lookup scheme for element classes generated from this parser. | |
Deprecated, use ``parser.set_element_class_lookup(lookup)`` instead. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Class Variable Summary | |
---|---|
PyCObject |
__pyx_vtable__ = <PyCObject object at 0x401cb9f8>
|
member_descriptor |
root = <member 'root' of 'lxml.etree.iterparse' objects>
|
Inherited from _BaseParser | |
getset_descriptor |
error_log = <attribute 'error_log' of 'lxml.etree._BaseP...
|
member_descriptor |
resolvers = <member 'resolvers' of 'lxml.etree._BasePars...
|
Method Details |
---|
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
|
__iter__(x)x.__iter__() <==> iter(x)
|
__new__(T, S, ...)T.__new__(S, ...) -> a new object with type S, a subtype of T
|
next(x)x.next() -> the next value, or raise StopIteration
|
Class Variable Details |
---|
__pyx_vtable__
|
root
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sat Aug 18 12:44:27 2007 | http://epydoc.sf.net |