Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9127921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:23:48+00:00 2026-06-17T07:23:48+00:00

Itunes is giving me an export xml structure that I’m not used to work

  • 0

Itunes is giving me an export xml structure that I’m not used to work with (see xml code):

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
    <dict>
        <key>68768</key>
        <dict>
            <key>Track ID</key><integer>68768</integer>
            <key>Name</key><string>ABBA Medley</string>
            <key>Artist</key><string>Party All Stars</string>           
            <key>Disc Number</key><integer>1</integer>
            <key>Track Number</key><integer>17</integer>
            <key>Persistent ID</key><string>B121116C66BE0F4B</string>
        </dict>
        <key>68781</key>
        <dict>
            <key>Track ID</key><integer>68781</integer>
            <key>Name</key><string>Afflitto</string>
            <key>Artist</key><string>Fiocco</string>
            <key>Disc Number</key><integer>1</integer>
            <key>Track Number</key><integer>9</integer>
            <key>Persistent ID</key><string>5D09837999591307</string>
        </dict>
        <key>68793</key>
        <dict>
            <key>Track ID</key><integer>68793</integer>
            <key>Name</key><string>Agadou</string>
            <key>Artist</key><string>Saradossa Band</string>
            <key>Disc Number</key><integer>1</integer>
            <key>Track Number</key><integer>4</integer>
            <key>Persistent ID</key><string>4DFFF3C3498C02B4</string>
        </dict>
    </dict>
</dict>
</plist>

My goal is to get following array when possible achieved with LinqToXml in c#:

17  ABBA Medley  B121116C66BE0F4B
9   Afflitto     5D09837999591307
4   Agadou       4DFFF3C3498C02B4

Is this even possible ?
I wrote some basic c# code but a lightning bolt strikes me on the way…

XDocument doc = XDocument.Load(iTunesXmlFile);
var linqtoxml = from node in doc.Descendants("dict") select node; // ooo Boy :(

foreach (var dict in linqtoxml)
{
   // and lightning bolt again...
}

Ps: As obvious, I can’t change the xml structure.
Pps: I know, this is a cleanup iTunes XML version, but the basic concept is presented as case study.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:23:49+00:00Added an answer on June 17, 2026 at 7:23 am

    The best solution that I could think of was following :

    List<Track> MyTrackList = new List<Track>();
    
    public class Track 
    {
        public int TrackNumber { get; set; }
        public string Name { get; set; }
        public string PersistentID { get; set; }
    } 
    
    XDocument doc = XDocument.Load(@"thexmlfile.xml");
    var linqtoxml = from element in doc.Descendants("plist").Descendants("dict").Descendants("dict").Descendants("dict")
                    select element;
    
    foreach (var dict in linqtoxml)
    {
        try
        {
            string myTrackNumber = dict.Descendants("key").Where(key => key.Value == "Track Number").Select(x => x.NextNode).SingleOrDefault().ToString(); 
            string myName = dict.Descendants("key").Where(key => key.Value == "Name").Select(x => x.NextNode).SingleOrDefault().ToString();                                 
            string myPersistentID = dict.Descendants("key").Where(key => key.Value == "Persistent ID").Select(x => x.NextNode).SingleOrDefault().ToString();
    
            MyTrackList.Add(new Track
            {
                TrackNumber = myTrackNumber,
                Name = myName,
                PersistentID = myPersistentID
            });
    
        }
        catch (Exception)
        {
            // Something wasn't set, so skip the node ...
        }            
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've learned that iTunes XML file is actually a plist, and instead of trying
In iTunes, you will see that the first two columns (the first narrow one
i used the code below in the levelManager.m to read values from a plist
iTunes will not sync an app with the same or lower version , which
I am parsing itunes library XML file using xslt grammar. Here's sample code void
I just could not sign in itunes connect suddenly( 2 hours ago until now).
I'm trying to construct a XML feed, and Groovy's MarkupBuilder is giving me headaches:
the iTunes song list display is a TableView that has a dotted scrollbar on
Itunes provide URL or all apps in App-store like to get details in JSON/XML
iTunes Connect is saying that my application executable is missing required architecture. At least

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.