mixins
xsdata.formats.dataclass.serializers.tree.mixins
TreeSerializer
dataclass
Bases: EventGenerator
Source code in xsdata/formats/dataclass/serializers/tree/mixins.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
render(obj)
abstractmethod
Serialize the input model instance to element tree.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj | T | The input model instance to serialize | required |
Returns:
Type | Description |
---|---|
Any | The generated element tree instance. |
Source code in xsdata/formats/dataclass/serializers/tree/mixins.py
21 22 23 24 25 26 27 28 29 30 |
|
build(obj, builder)
Feed the builder with events from input model instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj | T | The input model instance to serialize | required |
builder | TreeBuilder | The tree builder instance | required |
Source code in xsdata/formats/dataclass/serializers/tree/mixins.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
encode_data(data)
classmethod
Encode data for xml rendering.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | Any | The content to encode/serialize | required |
Returns:
Type | Description |
---|---|
str | The xml encoded data |
Source code in xsdata/formats/dataclass/serializers/tree/mixins.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|