[Tutor] Importing XML files.

mhysnm1964 at gmail.com mhysnm1964 at gmail.com
Sun Jan 20 22:17:21 EST 2019


All,

 

I am trying to import ITunes XML files. I have been doing some reading and I am somewhat confused with some XML terminology.

 

What is:

 

Tag – I think it is the <key> in the itunes library file.

Text = The text between the <key>

Attrib  -- don’t know.

 

If I am correct in my thinking. If you look up all the tags using the xml module. How do you then isolate all the name text? I do not have any working code at this present time. I have been playing with the xml methods and reading some example tutorials. But I am stumped with the above terminology which is a small road block. Below is an example extract of my xML ITunes to see if this helps. I am doing this in Python 3.7 for Windows 10. 

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

              <key>Major Version</key><integer>1</integer>

              <key>Minor Version</key><integer>1</integer>

              <key>Date</key><date>2019-01-14T03:56:30Z</date>

              <key>Application Version</key><string>12.8.0.150</string>

              <key>Features</key><integer>5</integer>

              <key>Show Content Ratings</key><true/>

              <key>Music Folder</key><string>file:///Volumes/Itunes/iTunes/iTunes%20Media/</string>

              <key>Library Persistent ID</key><string>F2D33B339F0788F0</string>

              <key>Tracks</key>

              <dict>

                           <key>6493</key>

                           <dict>

                                         <key>Track ID</key><integer>6493</integer>

                                         <key>Name</key><string>In Her Sights: A Montgomery Justice Novel, Book 1 (Unabridged)</string>

                                         <key>Artist</key><string>Robin Perini</string>

                                         <key>Album Artist</key><string>Robin Perini</string>

                                         <key>Album</key><string>In Her Sights (Unabridged)</string>

                                         <key>Genre</key><string>Audiobook</string>

                                         <key>Kind</key><string>Audible file</string>

                                         <key>Size</key><integer>206806038</integer>

                                         <key>Total Time</key><integer>25574318</integer>

                                         <key>Year</key><integer>2012</integer>

                                         <key>Date Modified</key><date>2015-12-12T23:48:18Z</date>

                                         <key>Date Added</key><date>2015-12-12T23:48:20Z</date>

                                         <key>Bit Rate</key><integer>64</integer>

                                         <key>Sample Rate</key><integer>22050</integer>

                                         <key>Comments</key><string>Jasmine 'Jazz' Parker, Jefferson County SWAT’s only female sniper, can thread the eye of a needle with a bullet. But she carries with her a secret from her past....</string>

                                         <key>Normalization</key><integer>790</integer>

                                         <key>Artwork Count</key><integer>1</integer>

                                         <key>Persistent ID</key><string>2C4CC3C31A2B95B5</string>

                                         <key>Track Type</key><string>File</string>

                                         <key>Protected</key><true/>

                           <key>Location</key><string>file:///Volumes/Itunes/iTunes/iTunes%20Media/Audiobooks/Robin%20Perini/In%20Her%20Sights_%20A%20Montgomery%20Justice%20Novel,%20Book%201%20(Unabridged).aax</string>

                                         <key>File Folder Count</key><integer>4</integer>

                                         <key>Library Folder Count</key><integer>1</integer>



More information about the Tutor mailing list