book.xml_helper module¶
XML 파싱 Helper.
-
class
book.xml_helper.XmlDictConfig(parent_element)[source]¶ Bases:
dictExample usage.
>>> tree = ElementTree.parse('your_file.xml') >>> root = tree.getroot() >>> xmldict = XmlDictConfig(root)
Or, if you want to use an XML string:
>>> xml_string = "<test>Hello World</test>" >>> root = ElementTree.XML(xml_string) >>> xmldict = XmlDictConfig(root)
And then use xmldict for what it is… a dict.