* Note: lxml will not work on my system. I was hoping to find a solution that is not related to lxml.
I have already gone through some of the documentation, and I am having difficulty making it work as I would like. I would like to parse an XML file that looks like this:
<dict> <key>1375</key> <dict> <key>Key 1</key><integer>1375</integer> <key>Key 2</key><string>Some String</string> <key>Key 3</key><string>Another string</string> <key>Key 4</key><string>Yet another string</string> <key>Key 5</key><string>Strings anyone?</string> </dict> </dict>
In the file I'm trying to manipulate, there are more "dict" that follow this. I would like to read the XML and output a text / dat file that would look like this:
1375, "Some String", "Another String", "Another String", "Strings any?"
...
Eof
** Initially, I tried to use lxml, but after many attempts to get it working on my system, I switched to using the DOM. Most recently, I tried to use Etree to accomplish this task. Please, for the sake of love for all that is good, will someone help me with this? I am relatively new to Python and would like to know how this works. I thank you in advance.
python xml parsing lxml
PleaseHelpTheNewGuy
source share