How can I convert XML into a Python object?

后端 未结 7 1809
醉话见心
醉话见心 2020-12-02 10:46

I need to load an XML file and convert the contents into an object-oriented Python structure. I want to take this:

7条回答
  •  忘掉有多难
    2020-12-02 11:17

    If googling around for a code-generator doesn't work, you could write your own that uses XML as input and outputs objects in your language of choice.

    It's not terribly difficult, however the three step process of Parse XML, Generate Code, Compile/Execute Script does making debugging a bit harder.

提交回复
热议问题