XmlVar

class xsdata.formats.dataclass.models.elements.XmlVar(index, name, qname, types, clazz, init, mixed, factory, tokens_factory, format, derived, any_type, required, nillable, sequential, 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 – 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

  • required (bool) – Field is mandatory

  • nillable (bool) – Field supports nillable content

  • sequential (bool) – Render values in sequential mode

  • list_element – 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

find_choice(qname)[source]

Match and return a choice field by its qualified name.

Return type

Optional[XmlVar]

find_value_choice(value, check_subclass)[source]

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

Return type

Optional[XmlVar]

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

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

Return type

Optional[XmlVar]

is_optional(value)[source]

Return whether this var instance is not required and the given value matches the default one.

Return type

bool

match_namespace(qname)[source]

Match the given qname to the wildcard allowed namespaces.

Return type

bool

__eq__(other)

Return self==value.

Return type

bool