xsdata.formats.dataclass.parsers.handlers.lxml module¶
-
class
xsdata.formats.dataclass.parsers.handlers.lxml.
LxmlEventHandler
(clazz, parser, queue=<factory>, objects=<factory>)[source]¶ Bases:
xsdata.formats.dataclass.parsers.mixins.XmlHandler
Content handler based on lxml iterparse api.
- Parameters
clazz (
Type
) –parser (
PushParser
) –queue (
List
) –objects (
List
) –
-
parse
(source)[source]¶ Parse an XML document from a system identifier or an InputSource.
The xml parser will ignore comments, recover from errors. The parser will parse the whole document and then walk down the tree if the process xinclude is enabled.
-
clazz
: Type¶
-
queue
: List¶
-
objects
: List¶
-
class
xsdata.formats.dataclass.parsers.handlers.lxml.
LxmlSaxHandler
(clazz, parser, queue=<factory>, objects=<factory>, data_frames=<factory>, flush_next=None)[source]¶ Bases:
xsdata.formats.dataclass.parsers.mixins.XmlHandler
Content handler based on lxml target api.
- Parameters
-
data_frames
: List¶
-
parse
(source)[source]¶ Parse an XML document from a system identifier or an InputSource.
The xml parser will ignore comments, recover from errors and clean duplicate namespace prefixes.
-
start
(tag, attrib, ns_map)[source]¶ Start element notification receiver.
The receiver will flush any previous active element, append a new data frame to collect data content for the next active element and notify the main parser to prepare for next binding instruction.
-
end
(tag)[source]¶ End element notification receiver.
The receiver will flush any previous active element and set the next element to be flushed.
- Parameters
tag (
str
) –
-
close
()[source]¶ Close document notification receiver.
The receiver will flush any previous active element and return the first item in the objects stack.
- Return type