0

suppose i have an xml file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <quarkSettings>
    <UpdatePath></UpdatePath>
    <Version>Development</Version>
    <Project>ABC</Project>
  </quarkSettings>
</configuration>

now i want get Project's value. I have written following code:

        import xml.etree.ElementTree as ET
        doc1 = ET.parse("Configuration.xml")
        for e in doc1.find("Project"):
                project =e.text

but it doesn't give the value.

1 Answer 1

2

i got the answer:

import xml.etree.ElementTree as ET            
doc1 = ET.parse(get_path_for_config_Quark_Release)
root = doc1.getroot()
for element in root.findall("quarkSettings"):
    project = element.find("Project").text
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.