use xpath instead of tag to get all matches from subtree instead of subelements.

This commit is contained in:
saadyousafarbi
2020-02-10 12:23:05 +05:00
parent a9bd66b480
commit dd994657ac

View File

@@ -25,7 +25,7 @@ class RawMixin(object):
@classmethod
def definition_from_xml(cls, xml_object, system):
pre_tag_data = [etree.tostring(pre_tag_info) for pre_tag_info in xml_object.findall('pre')]
pre_tag_data = [etree.tostring(pre_tag_info) for pre_tag_info in xml_object.findall('.//pre')]
data = etree.tostring(xml_object, pretty_print=True, encoding='unicode')
if pre_tag_data:
for index, pre_tag in enumerate(re.findall(PRE_TAG_REGEX, data)):