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.
- Parameters
container (
ContainerInterface
) –
-
container
: ContainerInterface¶
-
substitutions
: Optional[Dict[lxml.etree.QName, List[xsdata.codegen.models.Attr]]] = None¶
-
process
(target)[source]¶ Search and process attributes not derived from xs:enumeration or xs:any.
Build the substitutions map if it’s not initialized yet.
- Parameters
target (
Class
) –
-
process_attribute
(target, attr)[source]¶ Check if the given attribute matches any substitution class in order to clone it’s attributes to the target class.
The cloned attributes are placed below the attribute the are supposed to substitute.