WildcardNode#

class xsdata.formats.dataclass.parsers.nodes.WildcardNode(var, attrs, ns_map, position, factory)[source]#

XmlNode for extensible elements that can hold any attribute and content.

The resulting object tree will be a AnyElement instance.

Parameters:
  • var (XmlVar) – The xml var instance

  • attrs (Dict) – The element attributes

  • ns_map (Dict) – The element namespace prefix-URI map

  • position (int) – The current objects length, everything after this position are considered children of this node.

  • factory (Type) – The generic element factory

bind(qname, text, tail, objects)[source]#

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:
  • qname (str) – The element qualified name

  • text (Optional[str]) – The element text content

  • tail (Optional[str]) – The element tail content

  • objects (List) – The list of intermediate parsed objects

Return type:

bool

Returns:

Whether the binding process was successful or not.

classmethod fetch_any_children(position, objects)[source]#

Fetch the children of this node in the objects list.

The children are removed from the objects list.

Parameters:
  • position (int) – The position of the objects when this node was created.

  • objects (List) – The list of intermediate parsed objects

Return type:

List

Returns:

A list of parsed objects.

child(qname, attrs, ns_map, position)[source]#

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:
  • qname (str) – The element qualified name

  • attrs (Dict) – The element attributes

  • ns_map (Dict) – The element namespace prefix-URI map

  • position (int) – The current length of the intermediate objects

Return type:

XmlNode