@@ -606,22 +606,12 @@ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
606606 obj_ .build (child_ )
607607 self .set_Description (obj_ )
608608 elif nodeName_ == 'Identity' :
609- type_name_ = child_ .attrib .get ('{http://www.w3.org/2001/XMLSchema-instance}type' )
610- if type_name_ is None :
611- type_name_ = child_ .attrib .get ('type' )
612- if type_name_ is not None :
613- type_names_ = type_name_ .split (':' )
614- if len (type_names_ ) == 1 :
615- type_name_ = type_names_ [0 ]
616- else :
617- type_name_ = type_names_ [1 ]
618609
619- if type_name_ == "CIQIdentity3.0InstanceType" :
620- import stix .bindings .extensions .identity .ciq_identity_3_0 as ciq_identity_binding
621- obj_ = ciq_identity_binding .CIQIdentity3_0InstanceType .factory ()
622- else :
623- obj_ = IdentityType .factory () # IdentityType is not abstract
610+ from stix .bindings .extensions .identity import ciq_identity_3_0
624611
612+ # Look for xsi:type. If not there, build an instance of
613+ # IdentityType
614+ obj_ = lookup_extension (child_ , IdentityType ).factory ()
625615 obj_ .build (child_ )
626616 self .set_Identity (obj_ )
627617 elif nodeName_ == 'Role' :
@@ -1277,7 +1267,6 @@ def __init__(self, idref=None, id=None, Name=None, Related_Identities=None):
12771267 self .id = _cast (None , id )
12781268 self .Name = Name
12791269 self .Related_Identities = Related_Identities
1280- self .xsi_type = None
12811270 def factory (* args_ , ** kwargs_ ):
12821271 if IdentityType .subclass :
12831272 return IdentityType .subclass (* args_ , ** kwargs_ )
0 commit comments