Currently, the method object_to_xml_element() calls the method submodel_to_xml() after a case differentiation for isinstance(obj, model.SubmodelElement).
|
elif isinstance(obj, model.SubmodelElement): |
|
serialization_func = submodel_to_xml |
This is an easily fixable bug that can be resolved by calling the method submodel_element_to_xml() here instead.
However, some of the case differentiations in object_to_xml_element() are also covered in submodel_element_to_xml(), e.g. if isinstance(obj, model.DataElement), which leads to unnecessary code duplication. Therefore, the case differentiations that are duplicated in object_to_xml_element() from submodel_element_to_xml() should be removed.
Currently, the method
object_to_xml_element()calls the methodsubmodel_to_xml()after a case differentiation forisinstance(obj, model.SubmodelElement).basyx-python-sdk/sdk/basyx/aas/adapter/xml/xml_serialization.py
Lines 943 to 944 in e043960
This is an easily fixable bug that can be resolved by calling the method
submodel_element_to_xml()here instead.However, some of the case differentiations in
object_to_xml_element()are also covered insubmodel_element_to_xml(), e.g.if isinstance(obj, model.DataElement), which leads to unnecessary code duplication. Therefore, the case differentiations that are duplicated inobject_to_xml_element()fromsubmodel_element_to_xml()should be removed.