@@ -606,22 +606,12 @@ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
606
606
obj_ .build (child_ )
607
607
self .set_Description (obj_ )
608
608
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 ]
618
609
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
624
611
612
+ # Look for xsi:type. If not there, build an instance of
613
+ # IdentityType
614
+ obj_ = lookup_extension (child_ , IdentityType ).factory ()
625
615
obj_ .build (child_ )
626
616
self .set_Identity (obj_ )
627
617
elif nodeName_ == 'Role' :
@@ -1277,7 +1267,6 @@ def __init__(self, idref=None, id=None, Name=None, Related_Identities=None):
1277
1267
self .id = _cast (None , id )
1278
1268
self .Name = Name
1279
1269
self .Related_Identities = Related_Identities
1280
- self .xsi_type = None
1281
1270
def factory (* args_ , ** kwargs_ ):
1282
1271
if IdentityType .subclass :
1283
1272
return IdentityType .subclass (* args_ , ** kwargs_ )
0 commit comments