Answer the question
In order to leave comments, you need to log in
How to properly parse an external xml file in Django?
Hello, I'm doing a Django project. My task is to take the value from the form, find this value in the xml file and substitute id instead of the value. XML looks like this:
<ROWSET>
<ROW>
<element>Element_1</element>
<element_id>01</element_id>
<ROW>
<ROW>
<element>Element_2</element>
<element_id>02</element_id>
<ROW>
</ROWSET>
xml_file = etree.parse('/media/xml/example.xml')
find_data = etree.XPath("Element_1")
data_result = find_data(xml_file)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question