tree
xsdata.formats.dataclass.serializers.tree
TreeSerializer
dataclass
Bases: EventGenerator
Lxml tree serializer for data classes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
SerializerConfig
|
The serializer config instance |
SerializerConfig()
|
context
|
XmlContext
|
The models context instance |
XmlContext()
|
Source code in xsdata/formats/dataclass/serializers/tree.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
render(obj, ns_map=None)
Serialize the input model instance to a lxml etree instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Any
|
The input model instance to serialize |
required |
ns_map
|
dict | None
|
A user defined namespace prefix-URI map |
None
|
Returns:
| Type | Description |
|---|---|
ElementTree
|
The element tree instance. |
Source code in xsdata/formats/dataclass/serializers/tree.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |