XmlVar

class xsdata.formats.dataclass.models.elements.XmlVar(index, name, qname, types, init, mixed, tokens, format, derived, any_type, nillable, sequential, list_element, default, xml_type, namespaces, elements, wildcards, **kwargs)[source]

Class field binding metadata.

Parameters
  • index (int) – Field ordering

  • name (str) – Field name

  • qname (str) – Qualified name

  • types (Sequence[Type]) – List of all the supported data types

  • init (bool) – Include field in the constructor

  • mixed (bool) – Field supports mixed content type values

  • tokens (bool) – Field is derived from xs:list

  • format (Optional[str]) – Value format information

  • derived (bool) – Wrap parsed values with a generic type

  • any_type (bool) – Field supports dynamic value types

  • nillable (bool) – Field supports nillable content

  • sequential (bool) – Render values in sequential mode

  • list_element (bool) – Field is a list of elements

  • default (Any) – Field default value or factory

  • xml_Type – Field xml type

  • namespaces (Sequence[str]) – List of the supported namespaces

  • elements (Mapping[str, XmlVar]) – Mapping of qname-repeatable elements

  • wildcards (Sequence[XmlVar]) – List of repeatable wildcards

  • xml_type (str) –

  • kwargs (Any) –

find_choice(qname)[source]

Match and return a choice field by its qualified name.

Parameters

qname (str) –

Return type

Optional[XmlVar]

find_value_choice(value)[source]

Match and return a choice field that matches the given value type.

Parameters

value (Any) –

Return type

Optional[XmlVar]

find_type_choice(value, tp, tokens, check_subclass)[source]

Match and return a choice field that matches the given type.

Parameters
  • value (Any) –

  • tp (Type) –

  • tokens (bool) –

  • check_subclass (bool) –

Return type

Optional[XmlVar]

match_namespace(qname)[source]

Match the given qname to the wildcard allowed namespaces.

Parameters

qname (str) –

Return type

bool

__eq__(other)

Return self==value.

Parameters

other (Any) –

Return type

bool