diff --git a/xml_converter/generators/cpp_templates/compoundvalue.cpp b/xml_converter/generators/cpp_templates/compoundvalue.cpp index 20ff8247..3480fe65 100644 --- a/xml_converter/generators/cpp_templates/compoundvalue.cpp +++ b/xml_converter/generators/cpp_templates/compoundvalue.cpp @@ -22,7 +22,7 @@ using namespace std; compound_values = split(get_attribute_value(input), ","); if (compound_values.size() == {{ attribute_variables|length }}) { {% for n, attribute_variable in enumerate(attribute_variables) %} - {{attribute_name}}.{{attribute_variables[n].attribute_name}} = std::stof(compound_values[{{n}}]); + {{attribute_name}}.{{attribute_variable.attribute_name}} = std::stof(compound_values[{{n}}]); {% endfor %} } return {{attribute_name}}; @@ -32,11 +32,11 @@ using namespace std; string stringify_{{attribute_name}}({{class_name}} attribute_value) { string output; {% for n, attribute_variable in enumerate(attribute_variables) %} - {% if attribute_variables[n].attribute_name in xml_bundled_components %} + {% if attribute_variable.attribute_name in xml_bundled_components %} {% if n == 0: %} - output = to_string(attribute_value.{{attribute_variables[n].attribute_name}}); + output = to_string(attribute_value.{{attribute_variable.attribute_name}}); {% else %} - output = output + "," + to_string(attribute_value.{{attribute_variables[n].attribute_name}}); + output = output + "," + to_string(attribute_value.{{attribute_variable.attribute_name}}); {% endif %} {% endif %} {% endfor %}