Sections 5 and 6 of the specification say what generators and players must do. A generator must produce playlists that follow the element definitions of section 4. The remaining rules are about how a player reads them.
Graceful failure
A player that cannot render a track must go on to the next one. It must not interrupt the sequence.
Relative paths
Relative paths must be resolved using XML Base or RFC 2396. The base URI is chosen from these, highest priority first:
- A base embedded in the document (
xml:base). - The encapsulating entity.
- The URI the document was retrieved from.
- The application’s own context.
Generators should percent-encode paths: My%20Song.flac is correct and
My Song.flac is not.
<playlist version="1" xmlns="http://xspf.org/ns/0/"
xml:base="http://example.com/music/">
<trackList>
<track><location>My%20Song.flac</location></track>
</trackList>
</playlist>
Extension URIs
Applications must assign unique URIs from their own namespace to each
link, meta and extension element they use,
and should assign new URIs when the syntax or meaning changes.
What a playlist is not
The specification keeps a playlist to its purpose: it names objects to render and
their order. It is not a metadata format or a catalogue. Metadata belongs in external
sources, reached through link and meta, and a client finds
it there.
Versions
| Version | version attribute | Namespace | Date format |
|---|---|---|---|
| 0 | 0 | http://xspf.org/ns/0/ | ISO 8601 |
| 1 | 1 | http://xspf.org/ns/0/ | XML Schema dateTime |
The group began work in February 2004, reached rough consensus on version 0 in April 2004 and declared the tuned version to be version 1 in January 2005. The document was unfrozen for a final round of drafting between August and November 2006. Version 1 playlists are written to remain readable by version 0 parsers, which is why the namespace stays at 0.
File identification
| Property | Value |
|---|---|
| Extension | .xspf |
| Media type | application/xspf+xml in common use; the specification page does not state one |
| Encoding | Any encoding XML allows; UTF-8 in practice |
| Recognising a file | A root element playlist in the namespace http://xspf.org/ns/0/ |