xsdata.formats.dataclass.parsers.mixins module¶
-
class
xsdata.formats.dataclass.parsers.mixins.
PushParser
[source]¶ Bases:
xsdata.formats.bindings.AbstractParser
A generic interface for event based content handlers like sax.
- Parameters
config – Parser configuration.
-
abstract
start
(clazz, queue, objects, qname, attrs, ns_map)[source]¶ Queue the next xml node for parsing.
-
class
xsdata.formats.dataclass.parsers.mixins.
XmlNode
[source]¶ Bases:
abc.ABC
A generic interface for xml nodes that need to implement the two public methods to be used in an event based parser with start/end element events.
The parser needs to maintain a queue for these nodes and a list of objects that these nodes return.
-
abstract
child
(qname, attrs, ns_map, position)[source]¶ Initialize the next child node to be queued, when a new xml element starts.
This entry point is responsible to create the next node type with all the necessary information on how to bind the incoming input data.
-
abstract
-
class
xsdata.formats.dataclass.parsers.mixins.
XmlHandler
(parser, clazz, queue=<factory>, objects=<factory>)[source]¶ Bases:
object
Xml content handler interface.
- Parameters
parser (
PushParser
) – The parser instance to feed events.clazz (
Optional
[Type
]) – The model to bind the xml document data. If it’s not provided the parser is responsible to locate one from the xml context.queue (
List
) – The queue list of xml nodes.objects (
List
) – Temporary storage for intermediate objects, eg [(qname, object)]
-
clazz
: Optional[Type]¶
-
queue
: List¶
-
objects
: List¶
-
class
xsdata.formats.dataclass.parsers.mixins.
EventsHandler
(parser, clazz, queue=<factory>, objects=<factory>)[source]¶ Bases:
xsdata.formats.dataclass.parsers.mixins.XmlHandler
Content handler based on pre-recorded events.
- Parameters
parser (
PushParser
) –queue (
List
) –objects (
List
) –
-
clazz
: Optional[Type]¶
-
queue
: List¶
-
objects
: List¶