xsdata.formats.dataclass.parsers.handlers.native module¶
-
class
xsdata.formats.dataclass.parsers.handlers.native.
XmlEventHandler
(clazz, parser, queue=<factory>, objects=<factory>)[source]¶ Bases:
xsdata.formats.dataclass.parsers.mixins.XmlHandler
Content handler based on xml.ElementTree iterparse api.
- Parameters
clazz (
Type
) –parser (
PushParser
) –queue (
List
) –objects (
List
) –
-
ns_map
: Dict¶
-
parse
(source)[source]¶ Parse an XML document from a system identifier or an InputSource.
- Raises
XmlHandlerError – If process xinclude config is enabled.
- Parameters
source (
Any
) –- Return type
-
class
xsdata.formats.dataclass.parsers.handlers.native.
XmlSaxHandler
(clazz, parser, queue=<factory>, objects=<factory>, data_frames=<factory>, flush_next=None, ns_map=<factory>)[source]¶ Bases:
xsdata.formats.dataclass.parsers.handlers.lxml.LxmlSaxHandler
,xml.sax.handler.ContentHandler
Xml sax content handler.
- Parameters
-
ns_map
: Dict¶
-
parse
(source)[source]¶ Parse an XML document from a system identifier or an InputSource.
- Raises
XmlHandlerError – If process xinclude config is enabled.
- Parameters
source (
Any
) –- Return type
-
startElementNS
(name, qname, attrs)[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.
Converts name and attribute keys to fully qualified tags to respect the main parser api, eg (foo, bar) -> {foo}bar