xsdata.codegen.handlers.attribute_substitution module

class xsdata.codegen.handlers.attribute_substitution.AttributeSubstitutionHandler(container)[source]

Bases: xsdata.codegen.mixins.HandlerInterface

Apply substitution attributes to the given class recursively.

Substitution attributes are placed below the attribute the are supposed to substitute. Exclude enumerations and wildcard attributes from the process.

Parameters

container (ContainerInterface) –

container: ContainerInterface = None
substitutions: Optional[Dict[lxml.etree.QName, List[xsdata.codegen.models.Attr]]] = None
process(target)[source]
Parameters

target (Class) –

process_attribute(target, attr)[source]
Parameters
create_substitutions()[source]

Create reference attributes for all the classes substitutions and group them by their fully qualified name.

classmethod create_substitution(source, qname)[source]

Create an attribute with type that refers to the given source class and namespaced qualified name.

Parameters
  • source (Class) –

  • qname (QName) –

Return type

Attr