def sanitize_attribute(cls, attr: Attr): if attr.is_list: attr.fixed = False else: attr.restrictions.sequential = False if attr.is_optional or attr.is_xsi_type: attr.fixed = False attr.default = None
def process_attribute(cls, target: Class, attr: Attr, parents: List[str]): """Normalize attribute properties.""" attr.name = cls.attribute_name(attr.name) attr.display_type = cls.attribute_display_type(attr, parents) attr.default = cls.attribute_default(attr, target.ns_map) attr.xml_type = cls.xml_type_map.get(attr.tag) if attr.local_name: attr.local_name = text.suffix(attr.local_name)