found drama

get oblique

recordXML (2).

by Rob Friesel

Spent about an hour or so working revisions to the DTD etc. tonight. Fixed a few (in retrospect) obvious errors and beefed up a few other things. Addressed several of the items w/r/t/ potential issues/complications with compilations. Made the bold decision to atomize it more rather than less, particularly w/r/t/ favoring the artist-track relationship over the artist-album relationship; I felt this places the proper emphasis on songs as atomized units while allowing the flexibility w/in the DTD for compilations, mixes, etc. to fit more easily into the spec. Thus do I open it up to review…

<?xml version="1.0" encoding="UTF-8"?>

<!ELEMENT collection (record+)>

  <!ELEMENT record (album, tracklisting, original, label?, other?)>

    <!ELEMENT album (title, mixedby?)>

      <!ATTLIST album released NMTOKEN #IMPLIED

                    compilation ( false | true ) #REQUIRED


      <!ELEMENT title (#PCDATA)>

      <!ELEMENT mixedby (#PCDATA)>

    <!ELEMENT tracklisting (track+)>

      <!ELEMENT track (artist?, trackname, composer?)>

        <!ATTLIST track genre CDATA #IMPLIED

                        tracknum NMTOKEN #IMPLIED

                        bpm NMTOKEN #IMPLIED


        <!ELEMENT artist (#PCDATA)>

        <!ELEMENT trackname (#PCDATA)>

        <!ELEMENT composer (#PCDATA)>

    <!ELEMENT original (format)>

      <!ATTLIST original condition ( 1 | 2 | 3 | 4 | 5 ) #REQUIRED>

      <!ELEMENT format (#PCDATA)>

    <!ELEMENT label (#PCDATA)>

    <!ELEMENT other (grouping?, comments?, review*)>

      <!ELEMENT grouping (#PCDATA)>

      <!ELEMENT comments (#PCDATA)>

      <!ELEMENT review (#PCDATA)>

        <!ATTLIST review author CDATA #IMPLIED

                       source CDATA #IMPLIED


EXAMPLE! Right-click, save as… example.xml

Currently Playing: Depeche Mode “Free Love” (bootleg Deep Dish remix — super-sick!!)



    <album compilation="false"><title>(unknown)</title></album>

    <tracklisting><track genre="House"><artist>Depeche Mode</artist><trackname>Free Love (Deep Dish remix)</trackname></track></tracklisting>

    <original condition="5"><format>MP3/CBR@192</format></original>


About Rob Friesel

Software engineer by day, science fiction writer by night. Author of The PhantomJS Cookbook and a short story in Please Do Not Remove. View all posts by Rob Friesel →

2 Responses to recordXML (2).

Leave a Reply

Your email address will not be published. Required fields are marked *