update_message_from_xml method#178
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #178 +/- ##
==========================================
+ Coverage 98.64% 98.65% +0.02%
==========================================
Files 11 11
Lines 1754 1776 +22
Branches 168 173 +5
==========================================
+ Hits 1730 1752 +22
Misses 5 5
Partials 19 19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sadrasabouri
left a comment
There was a problem hiding this comment.
I just have two minor questions.
| """ | ||
| for tag, nodes in structure.items(): | ||
| for node in nodes: | ||
| element = ElementTree.SubElement(parent, tag) |
There was a problem hiding this comment.
Why don't we use the SafeElementTree here instead, like other places?
There was a problem hiding this comment.
Since the defusedxml library does not include the SubElement and Element classes, we used SafeElementTree for parsing and ElementTree for constructing the XML tree. The XML vulnerability mentioned is only a concern during parsing, not during tree construction.
There was a problem hiding this comment.
Since the defusedxml library does not include the SubElement and Element classes, we used SafeElementTree for parsing and ElementTree for constructing the XML tree. The XML vulnerability mentioned is only a concern during parsing, not during tree construction.
|
|
||
| root = ElementTree.Element("root") | ||
| _build_xml_element(root, xml_tree) | ||
| return "".join(ElementTree.tostring(element, encoding="unicode") for element in root) |
Reference Issues/PRs
#142
What does this implement/fix? Explain your changes.
README.mdupdatedResponseclassupdate_message_from_xmlmethod addedPromptclassupdate_message_from_xmlmethod addedAny other comments?