[Python-Dev] parse xml

Mike Tuller python at ce.anoka.k12.mn.us
Fri Nov 12 23:22:02 CET 2004


I am just starting with python. I have a problem where I want to take a 
document that is in xml and take the items and enter them into a mysql 
database. The database part I know, I just need some hints on where to 
look to be able to parse something like this.


                         <dict>
                                 <key>_name</key>
                                 <string>VLC</string>
                                 <key>info</key>
                                 <string>VLC media player 0.7.2, 
Copyright (c) 1996-2004 VideoLAN.</string>
                                 <key>lastModified</key>
                                 <date>2004-05-21T15:04:12Z</date>
                                 <key>path</key>
                                 <string>/Applications/VLC.app</string>
                                 <key>version</key>
                                 <string>0.7.2</string>
                         </dict>
                         <dict>
                                 <key>_name</key>
                                 <string>WeatherPop</string>
                                 <key>lastModified</key>
                                 <date>2003-06-19T05:35:22Z</date>
                                 <key>path</key>
                                 
<string>/Applications/WeatherPop.app</string>
                                 <key>version</key>
                                 <string>1.8.1</string>
                         </dict>


etc.etc.etc.

I want to be able to get the values for name and version for each 
application. I don't need any other information.

Can someone give me some ideas on where to look for more information on 
doing something like this?



Mike



More information about the Python-Dev mailing list