wildcard
xsdata.formats.dataclass.parsers.nodes.wildcard
WildcardNode
Bases: XmlNode
XmlNode for extensible elements that can hold any attribute and content.
The resulting object tree will be a :class:~xsdata.formats.dataclass.models.generics.AnyElement
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
var | XmlVar | The xml var instance | required |
attrs | Dict | The element attributes | required |
ns_map | Dict | The element namespace prefix-URI map | required |
position | int | The current objects length, everything after this position are considered children of this node. | required |
factory | Type | The generic element factory | required |
Source code in xsdata/formats/dataclass/parsers/nodes/wildcard.py
8 9 10 11 12 13 14 15 16 17 18 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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
bind(qname, text, tail, objects)
Bind the parsed data into a generic element.
This entry point is called when a xml element ends and is responsible to parse the current element attributes/text, bind any children objects and initialize new generic element that can fit any xml string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qname | str | The element qualified name | required |
text | Optional[str] | The element text content | required |
tail | Optional[str] | The element tail content | required |
objects | List | The list of intermediate parsed objects | required |
Returns:
Type | Description |
---|---|
bool | Whether the binding process was successful or not. |
Source code in xsdata/formats/dataclass/parsers/nodes/wildcard.py
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 |
|
fetch_any_children(position, objects)
classmethod
Fetch the children of this node in the objects list.
The children are removed from the objects list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
position | int | The position of the objects when this node was created. | required |
objects | List | The list of intermediate parsed objects | required |
Returns:
Type | Description |
---|---|
List | A list of parsed objects. |
Source code in xsdata/formats/dataclass/parsers/nodes/wildcard.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
child(qname, attrs, ns_map, position)
Initialize the next child wildcard node to be queued, when an 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. Wildcard nodes always return wildcard children.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qname | str | The element qualified name | required |
attrs | Dict | The element attributes | required |
ns_map | Dict | The element namespace prefix-URI map | required |
position | int | The current length of the intermediate objects | required |
Source code in xsdata/formats/dataclass/parsers/nodes/wildcard.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|