@@ -52,7 +52,7 @@ void updateParams(const ParserConfig &_config,
5252 _errors.push_back ({ErrorCode::ATTRIBUTE_MISSING,
5353 " Element identifier requires an element_id attribute, but the "
5454 " element_id is not set. Skipping element alteration:\n "
55- + ElementToString (childElemXml)
55+ + ElementToString (_errors, childElemXml)
5656 });
5757 continue ;
5858 }
@@ -67,7 +67,7 @@ void updateParams(const ParserConfig &_config,
6767 _errors.push_back ({ErrorCode::ATTRIBUTE_INVALID,
6868 " Missing name after double colons in element identifier. "
6969 " Skipping element alteration:\n "
70- + ElementToString (childElemXml)
70+ + ElementToString (_errors, childElemXml)
7171 });
7272 continue ;
7373 }
@@ -83,7 +83,7 @@ void updateParams(const ParserConfig &_config,
8383 {
8484 _errors.push_back ({ErrorCode::ATTRIBUTE_INVALID,
8585 " Action [" + actionStr + " ] is not a valid action. Skipping "
86- " element alteration:\n " + ElementToString (childElemXml)
86+ " element alteration:\n " + ElementToString (_errors, childElemXml)
8787 });
8888 continue ;
8989 }
@@ -102,7 +102,7 @@ void updateParams(const ParserConfig &_config,
102102 _errors.push_back ({ErrorCode::ATTRIBUTE_MISSING,
103103 " Element to be added is missing a 'name' attribute. "
104104 " Skipping element addition:\n "
105- + ElementToString (childElemXml)
105+ + ElementToString (_errors, childElemXml)
106106 });
107107 continue ;
108108 }
@@ -112,7 +112,7 @@ void updateParams(const ParserConfig &_config,
112112 {
113113 _errors.push_back ({ErrorCode::ATTRIBUTE_INVALID,
114114 " The 'name' attribute can not be empty. Skipping element addition:\n "
115- + ElementToString (childElemXml)
115+ + ElementToString (_errors, childElemXml)
116116 });
117117 continue ;
118118 }
@@ -129,7 +129,7 @@ void updateParams(const ParserConfig &_config,
129129 + " element_id='" + childElemXml->Attribute (" element_id" )
130130 + " '> because element already exists in included model. "
131131 + " Skipping element addition:\n "
132- + ElementToString (childElemXml)
132+ + ElementToString (_errors, childElemXml)
133133 });
134134 continue ;
135135 }
@@ -157,7 +157,8 @@ void updateParams(const ParserConfig &_config,
157157 _errors.push_back ({ErrorCode::ELEMENT_MISSING,
158158 " Could not find element <" + std::string (childElemXml->Name ())
159159 + " element_id='" + childElemXml->Attribute (" element_id" ) + " '>. " +
160- " Skipping element modification:\n " + ElementToString (childElemXml)
160+ " Skipping element modification:\n " +
161+ ElementToString (_errors, childElemXml)
161162 });
162163 continue ;
163164 }
@@ -194,7 +195,7 @@ void updateParams(const ParserConfig &_config,
194195 {
195196 _errors.push_back ({ErrorCode::ELEMENT_INVALID,
196197 " Unable to convert XML to SDF. Skipping element replacement:\n "
197- + ElementToString (childElemXml)
198+ + ElementToString (_errors, childElemXml)
198199 });
199200 continue ;
200201 }
@@ -355,7 +356,7 @@ ElementPtr initElementDescription(const tinyxml2::XMLElement *_xml,
355356 _errors.push_back ({ErrorCode::ELEMENT_INVALID,
356357 " Element [" + std::string (_xml->Name ()) + " ] is not a defined "
357358 " SDF element. Skipping element alteration\n : "
358- + ElementToString (_xml)
359+ + ElementToString (_errors, _xml)
359360 });
360361 return nullptr ;
361362 }
@@ -384,7 +385,7 @@ void handleIndividualChildActions(const ParserConfig &_config,
384385 " Missing an action attribute. Skipping child element modification "
385386 " with parent <" + std::string (_childrenXml->Name ()) + " element_id='"
386387 + std::string (_childrenXml->Attribute (" element_id" )) + " '>:\n "
387- + ElementToString (xmlChild)
388+ + ElementToString (_errors, xmlChild)
388389 });
389390 continue ;
390391 }
@@ -397,7 +398,7 @@ void handleIndividualChildActions(const ParserConfig &_config,
397398 " child element modification with parent <"
398399 + std::string (_childrenXml->Name ()) + " element_id='"
399400 + std::string (_childrenXml->Attribute (" element_id" )) + " '>:\n "
400- + ElementToString (xmlChild)
401+ + ElementToString (_errors, xmlChild)
401402 });
402403 continue ;
403404 }
@@ -411,7 +412,7 @@ void handleIndividualChildActions(const ParserConfig &_config,
411412 " Could not find element. Skipping child element removal "
412413 " with parent <" + std::string (_childrenXml->Name ()) + " element_id='"
413414 + std::string (_childrenXml->Attribute (" element_id" )) + " '>:\n "
414- + ElementToString (xmlChild)
415+ + ElementToString (_errors, xmlChild)
415416 });
416417 }
417418 else
@@ -430,7 +431,7 @@ void handleIndividualChildActions(const ParserConfig &_config,
430431 " Could not find element. Skipping child element modification "
431432 " with parent <" + std::string (_childrenXml->Name ()) + " element_id='"
432433 + std::string (_childrenXml->Attribute (" element_id" )) + " '>:\n "
433- + ElementToString (xmlChild)
434+ + ElementToString (_errors, xmlChild)
434435 });
435436 }
436437 else
@@ -455,7 +456,7 @@ void handleIndividualChildActions(const ParserConfig &_config,
455456 " child element modification with parent <"
456457 + std::string (_childrenXml->Name ()) + " element_id='"
457458 + std::string (_childrenXml->Attribute (" element_id" )) + " '>:\n "
458- + ElementToString (xmlChild)
459+ + ElementToString (_errors, xmlChild)
459460 });
460461 continue ;
461462 }
@@ -468,7 +469,7 @@ void handleIndividualChildActions(const ParserConfig &_config,
468469 " Unable to convert XML to SDF. Skipping child element alteration "
469470 " with parent <" + std::string (_childrenXml->Name ()) + " element_id='"
470471 + std::string (_childrenXml->Attribute (" element_id" )) + " '>:\n "
471- + ElementToString (xmlChild)
472+ + ElementToString (_errors, xmlChild)
472473 });
473474 continue ;
474475 }
@@ -486,7 +487,7 @@ void handleIndividualChildActions(const ParserConfig &_config,
486487 " Could not find element. Skipping child element replacement "
487488 " with parent <" + std::string (_childrenXml->Name ()) + " element_id='"
488489 + std::string (_childrenXml->Attribute (" element_id" )) + " '>:\n "
489- + ElementToString (xmlChild)
490+ + ElementToString (_errors, xmlChild)
490491 });
491492 continue ;
492493 }
@@ -498,7 +499,7 @@ void handleIndividualChildActions(const ParserConfig &_config,
498499 " Replacement element is missing a 'name' attribute. "
499500 " Skipping element replacement <" + std::string (_childrenXml->Name ())
500501 + " element_id='" + std::string (_childrenXml->Attribute (" element_id" ))
501- + " '>:\n " + ElementToString (xmlChild)
502+ + " '>:\n " + ElementToString (_errors, xmlChild)
502503 });
503504 continue ;
504505 }
@@ -525,7 +526,7 @@ void add(const ParserConfig &_config, const std::string &_source,
525526 {
526527 _errors.push_back ({ErrorCode::ELEMENT_INVALID,
527528 " Unable to convert XML to SDF. Skipping element addition:\n "
528- + ElementToString (_childXml)
529+ + ElementToString (_errors, _childXml)
529530 });
530531 }
531532}
@@ -557,7 +558,8 @@ void modifyAttributes(tinyxml2::XMLElement *_xml,
557558 {
558559 _errors.push_back ({ErrorCode::ATTRIBUTE_INVALID,
559560 " Attribute [" + attrName + " ] is invalid. "
560- " Skipping attribute modification in:\n " + ElementToString (_xml)
561+ " Skipping attribute modification in:\n " +
562+ ElementToString (_errors, _xml)
561563 });
562564 continue ;
563565 }
@@ -582,7 +584,7 @@ void modifyChildren(tinyxml2::XMLElement *_xml,
582584 {
583585 _errors.push_back ({ErrorCode::ELEMENT_MISSING,
584586 " Could not find element [" + elemName + " ]. "
585- " Skipping modification for:\n " + ElementToString (_xml)
587+ " Skipping modification for:\n " + ElementToString (_errors, _xml)
586588 });
587589 continue ;
588590 }
@@ -599,7 +601,7 @@ void modifyChildren(tinyxml2::XMLElement *_xml,
599601 _errors.push_back ({ErrorCode::ELEMENT_INVALID,
600602 " Value [" + std::string (xmlChild->GetText ()) + " ] for element ["
601603 + elemName + " ] is invalid. Skipping modification for:\n "
602- + ElementToString (_xml)
604+ + ElementToString (_errors, _xml)
603605 });
604606 continue ;
605607 }
@@ -620,9 +622,9 @@ void modifyChildren(tinyxml2::XMLElement *_xml,
620622 // sdf has child elements but no children were specified in xml
621623 std::stringstream ss;
622624 ss << " No modifications for element "
623- << ElementToString (xmlChild)
625+ << ElementToString (_errors, xmlChild)
624626 << " provided, skipping modification for:\n "
625- << ElementToString (_xml);
627+ << ElementToString (_errors, _xml);
626628 Error err (ErrorCode::WARNING, ss.str ());
627629 enforceConfigurablePolicyCondition (
628630 _config.WarningsPolicy (), err, _errors);
@@ -650,7 +652,7 @@ void modify(tinyxml2::XMLElement *_xml, const sdf::ParserConfig &_config,
650652 _errors.push_back ({ErrorCode::ELEMENT_INVALID,
651653 " Value [" + std::string (_xml->GetText ()) + " ] for element [" +
652654 std::string (_xml->Name ()) + " ] is invalid. Skipping modification for:\n "
653- + ElementToString (_xml)
655+ + ElementToString (_errors, _xml)
654656 });
655657 }
656658 }
@@ -688,7 +690,7 @@ void remove(const tinyxml2::XMLElement *_xml, const sdf::ParserConfig &_config,
688690 + std::string (xmlParent->Name ()) + " element_id='"
689691 + std::string (xmlParent->Attribute (" element_id" )) + " '> with parent <"
690692 + std::string (_xml->Name ()) + " >:\n "
691- + ElementToString (xmlChild)
693+ + ElementToString (_errors, xmlChild)
692694 });
693695 continue ;
694696 }
0 commit comments