XSPF Examples in the wild

From XiphWiki
Revision as of 10:56, 21 December 2007 by Jchris (talk | contribs) (Initial version of the xspf examples page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page contains examples of XSPF as found in the wild on playlisting websites and services. Please keep new examples in alphabetical order when adding them, so we can cut down on duplicates.

SeeqPod

See the SeeqPod documentation here.

Example XSPF:


 <?xml version='1.0' encoding='UTF-8' ?>
 <playlist version="1" xmlns="http://xspf.org/ns/0/" start="0" end="0" 
   total="26" prev="None" next="1">
 <title></title>
 <trackList>
   <track>
   <location>http://joniverse.com/resources/music/u2-one.mp3</location>
   <title>One</title>
   <creator>U2</creator>
   <extension application="seeqpod_metadata">
     <mp3_url_id>19646033</mp3_url_id>
     <has_music_rex>True</has_music_rex>
     <song_id>39445</song_id>
   </extension>
   </track>
 </trackList>
 </playlist>


Commentary (from Lucas on the Playlist mailing list):

First off, let's move the attributes in the root element to a namespace:

 <playlist version="1" xmlns="http://xspf.org/ns/0/"
 xmlns:pg="http://xspf.org/ns/pagination"
 pg:start="0" pg:end="0" pg:total="26" pg:prev="None" pg:next="1" />

(I don't know what all those values are, by the way. But I do think it would be great to do a pagination API, maybe based on Mark Nottingham's feed history RFC for Atom, and I am confident that this belongs in a namespace.)

Second, let's move that song_id up a level, so that other apps can use it too:

   <track>
   <location>http://joniverse.com/resources/music/u2-one.mp3</location>
   <title>One</title>
   <creator>U2</creator>
   <identifier>http://seeqpod.com/song_id/39445<identifier>
   <extension application="seeqpod_metadata">
     <mp3_url_id>19646033</mp3_url_id>
     <has_music_rex>True</has_music_rex>
   </extension>
   </track>

About the construction of the extension element here, I'm really happy to see somebody using that element well. Given how unclear the spec is on the topic it's rare to see that. You might argue that this stuff needs to be namespaced, but I honestly don't know if that's true. I would just say that anything within an extension element is not XSPF.

The one correction I'd make to this extension element is to change the "application" attribute to a URI:

 <extension application="http://seeqpod.com/seeqpod_metadata">