XML anyone?

Jump to First Reply
Posted:
in Genius Bar edited January 2014
ok, so i know jack about XML and databases, but according to the help center on the topic, the xml file that itunes exports can be imported into a database. can anyone tell me how this is done? preferably into a MySQL db?

Comments

  • Reply 1 of 2
    I'm going to make this quick:

    Yes. It's possible.



    Using PHP, you can:

    1: parse the contents of the file to determine the databse keys and create a CREATE TABLE query. Or you could do this by hand (probably easier).



    2: parse the file again, using the <key> and <string> tags to create a INSERT query WHERE [<key>] = "[<string>]", etc. Use the instance of <dict> to control row breaks. The gist is to use what's in between <key> and </key> as column identifiers and whats in between <string> and </string> as column data. This could also be done using Perl, Java, etc. as long as you can connect to your database, you're fine.



    Or something like that.
     0Likes 0Dislikes 0Informatives
  • Reply 2 of 2
    damn, looks like i gots me some more phplernin to do
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.