INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How can I export a list properly?  (Read 2237 times)

MarkCoutinho

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 676
How can I export a list properly?
« on: December 24, 2004, 07:21:51 am »

I do know how to export a playlist, but I can't get it right for the purpose I intend to use:

Of the exported list I want to make an Access-database which contains the fields I exported.
No problemo, however, because I want to use the lyrics-field too everything gets messed up. Every line of the lyrics is considered to be a new record.

Same in MS Excel.

I used the HTML, MPL, M3U and ASCII export funtions.
Nothing works.

So: has anyone got a tip for me how to get all my lyrics in an Access-database?

Thanks!
Logged
Mark Coutinho
Dutch Top 40 collector of lyrics, sleeves and bios

IlPadrino

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 496
Re: How can I export a list properly?
« Reply #1 on: December 24, 2004, 08:07:10 am »

Use MC XML Export with the MPL2Access preset found at http://pages.sbcglobal.net/scottraymond/Presets.htm.  MC XML Export should be available on the plugins page.

Logged

MarkCoutinho

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 676
Re: How can I export a list properly?
« Reply #2 on: December 24, 2004, 08:42:06 am »

Thanks,

tried it, but, as it says in the ReadMe.txt: it can't handle lyrics for that field is too long.

Any other suggestions please?

Thanks!
Logged
Mark Coutinho
Dutch Top 40 collector of lyrics, sleeves and bios

IlPadrino

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 496
Re: How can I export a list properly?
« Reply #3 on: December 24, 2004, 06:54:34 pm »

Sorry about that...  you might write Scott on the topic http://yabb.jriver.com/interact/index.php?topic=24875.0 - he's working on a new version.

Can you export the library as an MPL directly from MC with the lyrics field included?  If so, you can use msxml to apply the MPL2Access .xsl and save the result.  If you need help with msxml, let me know and I can walk you through it.
Logged

MarkCoutinho

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 676
Re: How can I export a list properly?
« Reply #4 on: December 27, 2004, 02:18:15 am »

Well, I used MCMLExport to export my list, including the lyrics-field. That didn't work.
Could you tell me more about MSXML then? Thanks!
Logged
Mark Coutinho
Dutch Top 40 collector of lyrics, sleeves and bios

IlPadrino

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 496
Re: How can I export a list properly?
« Reply #5 on: December 27, 2004, 10:07:53 am »

Well, I used MCMLExport to export my list, including the lyrics-field. That didn't work.
Could you tell me more about MSXML then? Thanks!

I'm suggesting you export the MPL (which is just a fancy name for an XML document that conforms to J. Rivers's XML vocabulary) directly with MC.  When you export a playlist, one of the options is MPL.  If you open up the MPL, you'll see that it is, indeed, an XML document.

You can use the .xsl in the MPL2Access preset to manually transform the MPL into something that Access can easily import.  By "manually" I mean using Microsoft's MSXML executable.   If you want to read more about XML and MC, take a look at http://pages.sbcglobal.net/scottraymond/downloads/XML%20Primer.pdf

If you have any specific questions, let me know.
Logged

IlPadrino

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 496
Re: How can I export a list properly?
« Reply #6 on: December 27, 2004, 10:18:51 am »

Thanks,

tried it, but, as it says in the ReadMe.txt: it can't handle lyrics for that field is too long.

Any other suggestions please?

Thanks!

OK...  I'm sorry - I thought you were talking about a limitation with MC XML Export when you referred to a readme.txt.  There isn't a readme.txt in the MPL2Access preset (I hate the thought of telling people they *have* to read something).  Looking over the HowToImportToAccess.txt, I do see the problem you're talking about.

Give me a little bit and I'll try to overcome the limitation.

[Thanks, Scott_r, for clearing this up]

P.S.  Please e-mail me a small (i.e. about ten media items) MPL containing the lyrics field to scottraymond@sbcglobal.net
Logged

MarkCoutinho

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 676
Re: How can I export a list properly?
« Reply #7 on: December 31, 2004, 02:29:05 am »

Great, thanks.

I'm looking forward to your solution!
Logged
Mark Coutinho
Dutch Top 40 collector of lyrics, sleeves and bios

IlPadrino

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 496
Re: How can I export a list properly?
« Reply #8 on: December 31, 2004, 08:52:55 pm »

Great, thanks.

I'm looking forward to your solution!

OK...  here's a workaround, although it's not automated.  Maybe when scott_r finishes his rewrite of MC XML Export it will support XSLT2.0, which I think allows the create of two outputs.  It will soon become clear why this is needed.

If you run the export without the lyrics field, everything should be just fine.  Then:

1.  Go ahead and import this into Access as described in the preset documentation.
2.  Then manually add the lyrics field - it's probably important that you put it where it belongs (i.e. after Last Played and before Media Type).  Make sure the field data type is memo vice text.
3.  Export the MediaItems table (File->Export->(Save as type xml and Filename "MediaItems" in the same directory you exported the XML to)->Export->(check only Schema...)->OK.   This will create MediaItems.xsd in the same directory as the exported XML.
4.  Export the XML with MC XML Export, but this time check the Lyrics field.
5.  Replace the second line of the exported XML to
Code: [Select]
<dataroot xmlns:foo="NoURL" xmlns:od="urn:schemas-microsoft-com:officedata" xsi:noNamespaceSchemaLocation="MediaItems.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">This associates the XML with the schema.
6.  Import the XML into access - you can either start a new database or delete the old table.

That's it.  You'll only have to do most of this once.   The only thing you'd need to repeat is step 5 every time you export the XML from MC.  If you find this works well for you, I can automate this for you.

So...  if XSLT2.0 lets you create two output documents (I'm pretty sure it does), I could automate the creation of the XSD at the same time the XML is created.  But until scott_r adds XSLT2.0 support (or rather, if...) there's nothing I can think of to automate this.

Sorry the explanation is worded a bit poorly - I don't have the time right now to make it more succint.  If you need specific help, let me know...
Logged

MarkCoutinho

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 676
Re: How can I export a list properly?
« Reply #9 on: January 03, 2005, 03:55:47 am »

Thanks again, I did all the steps but it didn't work out.
Here's what I did:

1) I exported my playlist without the lyrics-field with MC XML Export
2) I imported this one in Access
Although I checked the Artist and the Name field, the artist-field wasn't imported, although it's visible in the XML-file. I haven't got a clue how to import that field too. Any suggestion?
3) Then I edited the Access table (added lyrics-field) and exported it (saved as "MediaItems.xml")
4) With MC XML Export exported the lyrics-field (called it justlyrics.xml)
5) Edited the XML-file:
Original second line was:
<MPL Version="2.0">
I replaced that with your code:
<dataroot xmlns:foo="NoURL" xmlns:od="urn:schemas-microsoft-com:officedata" xsi:noNamespaceSchemaLocation="MediaItems.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
6) Created a new database and imported the justlyrics.xml but there I got this error-message: 'The name in the end tag of the element must match the element type in the start tag

What should I do or what did I do wrong?
Logged
Mark Coutinho
Dutch Top 40 collector of lyrics, sleeves and bios

IlPadrino

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 496
Re: How can I export a list properly?
« Reply #10 on: January 03, 2005, 08:08:07 pm »

Mark,

Here's my response to what you did...

2)  E-mail me the xml and I'll tell you why...  or paste a few media items here.
3)  You make it sound as if you didn't follow my instructions (3.)  Are you using Access2003 or an older version?  The idea is to create a schema (.xsd) that will be used to tell Access the imported XML should create a memo field instead of the default text field.  Maybe there's an easier way to do this, but I don't know it.  If you can't make this .xsd (perhaps your version of Access doesn't support it), feel free to e-mail me the .mdb and I'll make it for you.  It only needs to be done once.  Indeed, if you aren't exporting any custom fields, I can give you one right now.
4)  You need to export *all* the fields in this step, not just lyrics.
5)  I don't think you're editing the export created using the MPL2Access preset with MC XML Export.

Anyway...  I know this isn't exactly straight-forward.  The idea behind MC XML Export and the presets were to get one-click exports the way you wanted them.  But given the size of your library and the fact that this work only needs to be done once, I'd think it's worth it.
Logged

MarkCoutinho

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 676
Re: How can I export a list properly?
« Reply #11 on: January 04, 2005, 02:56:45 am »

Hi (I don't know your real name),

2) I do want to send you a zip of that xml and of the .mdb I made of that, but I don't know your email address. Mail me on my address and I send it to you.
3) I do use Access 2003.
4) I'll do that when you've mailed me the things mentioned above back
5) I don't know what you mean with "using the MPL2Access preset with MC XML Export". How do I do that?

Thanks again!
Logged
Mark Coutinho
Dutch Top 40 collector of lyrics, sleeves and bios

IlPadrino

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 496
Re: How can I export a list properly?
« Reply #12 on: January 04, 2005, 09:02:34 pm »

You've got mail...

Quote
5) I don't know what you mean with "using the MPL2Access preset with MC XML Export". How do I do that?

You don't know how to use MC XML Export or you don't know how to use the preset MPL2Access?
Logged
Pages: [1]   Go Up