[Playlist] last call for comments, motion to refreeze

Matthias Friedrich matt at mafr.de
Sun Sep 24 08:32:03 UTC 2006


On Saturday, 2006-09-23, Lucas Gonze wrote:
> The most up to date version of the updated version of the spec is at
> http://gonze.com/xspf/xspf.org/draft-xspf-v1.html and, as always, 
> available from the subversion repository at 
> http://svn.xiph.org/websites/xspf.org/.

> Changes:

> - remove IANA considerations sections, since it is redundant with 
> external media type registration documents.  Media type registration is 
> a separate document.

> - remove Recipes section, since it is too unstable and not polished 
> enough for a normative document.

> - remove reference to source control URI, since that is too unstable for 
> a normative specification.  We're better off just ratifying the current 
> version and refreezing for all time.

Agreed so far.

> -deleted reference to Relax NG schema at mayhem-chaos.net, because it is 
> not stable enough.

Hmm, I'm not completely happy with that, but I have to agree. If we had
fixed the schema earlier, then it would be possible to keep it in the
spec. Unfortunately, I didn't have Relax NG knowledge until I defined
the MusicBrainz Metadata XML recently.

Anyway, since schemas are valuable resources, I created an up to date
Relax NG schema, based on my v1 XML Schema. The Relax NG was created
from scratch (not based on Rob's draft) and it hasn't been tested
extensively because I was unable to find the test suite :-)

Both schemas are attached to this mail and I'd suggest to put them on
the website, flagged as informational.

Cheers,
	Matthias
-------------- next part --------------
<?xml version="1.0" encoding="UTF-8"?>

<!-- ==================================================================
     Relax NG Schema for XSPF Version 1

     $Id$

     This schema was written as a service for developers who want
     to validate the playlists generated by their applications.
     Nobody claims it is perfect, so if you find bugs please report
     them. In any case, the spec overrides this schema.

     Further information about XSPF is available at http://www.xspf.org


     Copyright (c) 2005 Matthias Friedrich <matt at mafr.de>

     The schema is released under the Creative Commons 
     Attribution-ShareAlike 2.5 license.

     http://creativecommons.org/licenses/by-sa/2.5/

     ================================================================== -->


<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
         ns="http://xspf.org/ns/0/">


    <start>
        <ref name="def_playlist-element"/>
    </start>


    <define name="def_playlist-element">
        <element name="playlist">
            <attribute name="version">
                <data type="string">
                    <param name="pattern">\d+</param>
                </data>
            </attribute>

            <optional>
                <element name="title">
                    <text/>
                </element>
            </optional>
            <optional>
                <element name="creator">
                    <text/>
                </element>
            </optional>
            <optional>
                <element name="annotation">
                    <text/>
                </element>
            </optional>
            <optional>
                <element name="info">
                    <text/>
                </element>
            </optional>
            <optional>
                <element name="location">
                    <data type="anyURI"/>
                </element>
            </optional>
            <optional>
                <element name="identifier">
                    <data type="anyURI"/>
                </element>
            </optional>
            <optional>
                <element name="image">
                    <data type="anyURI"/>
                </element>
            </optional>
            <optional>
                <element name="date">
                    <data type="dateTime"/>
                </element>
            </optional>
            <optional>
                <element name="license">
                    <data type="anyURI"/>
                </element>
            </optional>

            <optional>
                <ref name="def_attribution-element"/>
            </optional>

            <zeroOrMore>
                <ref name="def_link-element"/>
            </zeroOrMore>
            <zeroOrMore>
                <ref name="def_meta-element"/>
            </zeroOrMore>
            <zeroOrMore>
                <ref name="def_extension-element"/>
            </zeroOrMore>

            <element name="trackList">
                <zeroOrMore>
                    <ref name="def_track-element"/>
                </zeroOrMore>
            </element>
        </element>
    </define>


    <define name="def_attribution-element">
        <element name="attribution">
            <zeroOrMore>
                <element name="location">
                    <data type="anyURI"/>
                </element>
            </zeroOrMore>
        </element>
    </define>


    <define name="def_link-element">
        <element name="link">
            <attribute name="rel">
                <data type="anyURI"/>
            </attribute>

            <data type="anyURI"/>
        </element>
    </define>


    <define name="def_meta-element">
        <element name="meta">
            <attribute name="rel">
                <data type="anyURI"/>
            </attribute>

            <text/>
        </element>
    </define>


    <define name="def_extension-element">
        <element name="extension">
            <attribute name="application">
                <data type="anyURI"/>
            </attribute>

            <zeroOrMore>
                <choice>
                    <element>
                        <anyName/>
                        <ref name="def_anything"/>
                    </element>
                    <text/>
                </choice>
            </zeroOrMore>
        </element>
    </define>


    <define name="def_anything">
        <zeroOrMore>
            <choice>
                <element>
                    <anyName/>
                    <ref name="def_anything"/>
                </element>
                <attribute>
                    <anyName/>
                </attribute>
                <text/>
            </choice>
         </zeroOrMore>
    </define>


    <define name="def_track-element">
        <element name="track">
            <zeroOrMore>
                <element name="location">
                    <data type="anyURI"/>
                </element>
            </zeroOrMore>
            <zeroOrMore>
                <element name="identifier">
                    <data type="anyURI"/>
                </element>
            </zeroOrMore>

            <optional>
                <element name="title">
                    <text/>
                </element>
            </optional>
            <optional>
                <element name="creator">
                    <text/>
                </element>
            </optional>
            <optional>
                <element name="annotation">
                    <text/>
                </element>
            </optional>
            <optional>
                <element name="info">
                    <text/>
                </element>
            </optional>
            <optional>
                <element name="image">
                    <data type="anyURI"/>
                </element>
            </optional>
            <optional>
                <element name="album">
                    <text/>
                </element>
            </optional>
            <optional>
                <element name="trackNum">
                    <data type="nonNegativeInteger"/>
                </element>
            </optional>
            <optional>
                <element name="duration">
                    <data type="nonNegativeInteger"/>
                </element>
            </optional>

            <zeroOrMore>
                <ref name="def_link-element"/>
            </zeroOrMore>
            <zeroOrMore>
                <ref name="def_meta-element"/>
            </zeroOrMore>
            <zeroOrMore>
                <ref name="def_extension-element"/>
            </zeroOrMore>
        </element>
    </define>

</grammar>
-------------- next part --------------
<?xml version="1.0" encoding="UTF-8"?>

<!--
      XML Schema for XSPF Version 1

      $Id$

      This schema was written as a service for developers who want
      to validate the playlists generated by their applications.
      Nobody claims it is perfect, so if you find bugs please report
      them. In any case, the spec overrides this schema.

      Further information about XSPF is available at http://www.xspf.org


      Copyright (c) 2005 Matthias Friedrich <matt at mafr.de>

      The schema is released under the Creative Commons
      Attribution-ShareAlike 2.0 license.

      http://creativecommons.org/licenses/by-sa/2.0/


      ChangeLog:
          * 2005-10-12: Fixed an error: the "extension" element now
			has an "application" attribute, like in the spec.
-->

<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema"
            xmlns:xspf = "http://xspf.org/ns/0/"
            targetNamespace="http://xspf.org/ns/0/"
	    elementFormDefault="qualified"
	    attributeFormDefault="unqualified">

<xsd:element name="playlist" type="xspf:PlaylistType"/>

<xsd:complexType name="PlaylistType">
  <xsd:sequence>
    <xsd:element name="title" type="xsd:string" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="creator" type="xsd:string" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="annotation" type="xsd:string" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="info" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="location" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="identifier" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="image" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="date" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="license" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="attribution" type="xspf:AttributionType" minOccurs="0" maxOccurs="1"/>

    <xsd:element name="link" type="xspf:LinkType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="meta" type="xspf:MetaType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="extension" type="xspf:ExtensionType" minOccurs="0" maxOccurs="unbounded"/>

    <xsd:element name="trackList" type="xspf:TrackListType" minOccurs="1" maxOccurs="1"/>
  </xsd:sequence>
  <xsd:attribute name="version" type="xspf:VersionType" use="required"/>
</xsd:complexType>

<xsd:simpleType name="VersionType">
  <xsd:restriction base="xsd:string">
    <xsd:pattern value="\d+"/>
  </xsd:restriction>
</xsd:simpleType>

<xsd:complexType name="AttributionType">
  <xsd:sequence>
    <xsd:element name="location" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="LinkType">
  <xsd:simpleContent>
    <xsd:extension base="xsd:anyURI">
      <xsd:attribute name="rel" type="xsd:anyURI" use="required"/>
    </xsd:extension>
  </xsd:simpleContent>
</xsd:complexType>

<xsd:complexType name="MetaType">
  <xsd:simpleContent>
    <xsd:extension base="xsd:string">
      <xsd:attribute name="rel" type="xsd:anyURI" use="required"/>
    </xsd:extension>
  </xsd:simpleContent>
</xsd:complexType>

<xsd:complexType name="ExtensionType">
  <xsd:complexContent mixed="true">
    <xsd:restriction base="xsd:anyType">
      <xsd:sequence>
        <xsd:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attribute name="application" type="xsd:anyURI" use="required"/>
    </xsd:restriction>
  </xsd:complexContent>
</xsd:complexType>

<xsd:complexType name="TrackListType">
  <xsd:sequence>
    <xsd:element name="track" type="xspf:TrackType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="TrackType">
  <xsd:sequence>
    <xsd:element name="location" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="identifier" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="title" type="xsd:string" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="creator" type="xsd:string" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="annotation" type="xsd:string" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="info" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="image" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="album" type="xsd:string" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="trackNum" type="xsd:nonNegativeInteger" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="duration" type="xsd:nonNegativeInteger" minOccurs="0" maxOccurs="1"/>

    <xsd:element name="link" type="xspf:LinkType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="meta" type="xspf:MetaType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="extension" type="xspf:ExtensionType" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

</xsd:schema>


More information about the Playlist mailing list