Code: Alles auswählen
from xml.etree import cElementTree as ET
xml_data = """<?xml version="1.0" encoding="utf-8" ?>
<D:lockinfo xmlns:D="DAV:">
<D:locktype><D:write/></D:locktype>
<D:lockscope><D:exclusive/></D:lockscope>
</D:lockinfo>"""
e = ET.XML(xml_data)
locktype_element = e.find(".//{DAV:}locktype")
locktype = locktype_element.getchildren()[0]
print locktype
Ich würde gern den String "write" erhalten. Wie geht das?<Element '{DAV:}write' at 0x7ffa3ded94b0>