Saving XSPF playlist generates invalid XML

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Donama
Blank Cone
Blank Cone
Posts: 10
Joined: 24 May 2010 05:08

Saving XSPF playlist generates invalid XML

Postby Donama » 10 Jun 2010 08:07

I'm putting this here in the forum because I couldn't find a ticket about it opened on Trac.

Saving an XSPF playlist that wasn't originally generated in VLC generates invalid XML (and by that fact invalid XSPF). I'm not sure why this doesn't happen with the VLC-generated XSPF but perhaps the serialisation routine is slightly different if no VLC extensions are found.

To replicate:

1. Save the following XML as an XSPF file, noting that it will validate with Pipping's XSPF xml validator (http://validator.xspf.org/):

Code: Select all

<?xml version="1.0" encoding="utf-8"?> <playlist xmlns="http://xspf.org/ns/0/" xmlns:spf="http://xspf.org/ns/0/" version="1"> <title>2008-07-23 Nathan import</title> <identifier>itunes:playlist:2008-07-23NathanImport</identifier> <trackList> <track> <location>file://localhost/F:/musik/Bob%20Marley%20&%20the%20Wailers/Natural%20Mystic_%20The%20Legend%20Lives%20On/07%20Africa%20Unite.m4a</location> <creator>Bob Marley & the Wailers</creator> <album>Natural Mystic: The Legend Lives On</album> <title>Africa Unite</title> <duration>173776</duration> </track> <track> <location>file://localhost/F:/musik/Muse/Black%20Holes%20&%20Revelations/07%20Assassin.mp3</location> <creator>Muse</creator> <album>Black Holes & Revelations</album> <title>Assassin</title> <duration>211252</duration> </track> </trackList> </playlist>
2. Double-click it to open in VLC.
3. Click Media >> Save Playlist to File...
4. Now check the saved file in any XML validating tool (eg. Programmer's Notepad, Oxygen, XMLSpy, or even Pipping's XSPF validator mentioned above). The XML is invalid. The ampersands (&) in the file paths are not XML-encoded as (&).

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Saving XSPF playlist generates invalid XML

Postby Jean-Baptiste Kempf » 10 Jun 2010 17:25

Use vlc 1.1.0
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Saving XSPF playlist generates invalid XML

Postby erwan10 » 10 Jun 2010 18:56

vlc1.1 has no problem with this ampersand issue.

Yet, the uri format file://localhost/C:/ ..... is not right, and won't work with vlc.
It has to be file:///C:/.......

Donama
Blank Cone
Blank Cone
Posts: 10
Joined: 24 May 2010 05:08

Re: Saving XSPF playlist generates invalid XML

Postby Donama » 15 Jun 2010 02:04

Thanks jb and erwan. Erwan, are you saying the URI in my XSPF is an invalid URI or it just doesn't work in VLC?

Also wondering why this wouldn't be enforced by the XSPF schema, but that's another topic.

Rémi Denis-Courmont
Developer
Developer
Posts: 15213
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Saving XSPF playlist generates invalid XML

Postby Rémi Denis-Courmont » 16 Jun 2010 03:09

file://localhost/ should work, but it's not recommended.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Donama
Blank Cone
Blank Cone
Posts: 10
Joined: 24 May 2010 05:08

Re: Saving XSPF playlist generates invalid XML

Postby Donama » 03 Aug 2010 09:59

If the format file://localhost/X: is not recommended, then what is recommended? Where can I find out more about what VLC expects? Thanks.

Rémi Denis-Courmont
Developer
Developer
Posts: 15213
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Saving XSPF playlist generates invalid XML

Postby Rémi Denis-Courmont » 03 Aug 2010 17:07

file:///X:
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 13 guests