I use lxml.objectify
for easy parsing and working with an XML file. For audit reasons, I have to save the derived object along with the source XML of the element.
root = lxml.objectify.fromstring(self.get_xml_data()) for i, elem in enumerate(root.elements): # create new database entry based on elem elem_obj.source_code = turn_elem_into_xml(elem)
How could I implement turn_elem_into_xml
?
\ edit: why downvote?
source share